Android pop up list dialog - android

I want to add an dialog to my application. I want it to launch as soon as the first activity loads. But instead of having just a single message to display and having a 'yes' and 'no' button like this
I want it to display a list of message like this
If there is a tutorial that speaks on this subject I would be happy to look at it and also I would anybody by any chance know how to align these list with bulletins.

1 Create a custom dialog layout (XML file).
2 Attach the layout to Dialog.
3 Display the Dialog.
4 Done.
Tutorial here

If there is a tutorial that speaks on this subject I would be happy to look at it
Your best bet would be to start Here in the Docs. They show a great example of doing it with a Dialog.
Another option, if this can be the entire Activity since you want it to happen when if first starts, is to use a ListView for your Activity and use setChoiceMode() on it. You can find more about that in the Docs
With this second option, you can make the Activity appear as a Dialog by adding this line to your <activity> tag in the manifest.xml
android:theme="#android:style/Theme.Dialog"

Related

How to show a pop up in Android and still be able to click on fragment

I'm trying to create a pop up that will notify the user if they got the correct answer, the user can then click the continue button to the next question. The pic below from the Duolingo app shows exactly what I want.
What class can be used to do this?
Use the PopupWindow class. It does exactly what you want. That's what has been used in the screenshot you posted above.
Here's an example: How to Implement Popup Window in Android.

Android - Show more information on a popup

I'm developing an app that includes reviews of items and due to my design, I want to only show all the reviews in a popup window like in Google Play Store:
What should I use to create that white panel that appears over the current window and contains the necessary information? This should be simple but I'm a newbie and I can't seem to figure out what this "widget" is. Please help me if you are familiar with this so I can use this cool design pattern. Thanks.
It seems you want to display a layout as a popup in another activity.
If you want to do this using an Activity instead of a Dialog, you can do this by setting the activity's theme to android:theme="#android:style/Theme.Dialog" in the manifest - this will make the activity appear like a dialog (floating on top of whatever was underneath it).
A better way to do it would be using a DialogFragment. You can display information in the form of a popup and it will have its own lifecycle. That will be much better than displaying an activity like a dialog
Ram kiran's answer is a good one and one which I like to give also. But just so you have another option to look at you can consider PopupWindow
As stated in the docs, it is
A popup window that can be used to display an arbitrary view. The popup window is a floating container that appears on top of the current activity.
I've used this and it works out nicely in some situations. It really depends on what your exact needs are as to which will work best for you.

Android Popup box similar to google license?

Hmm, looking at the way android popup it's text for the license with scroll, anyway to replicate it? Screen as below
For creating this pop up you need to do like this.
1) create an activity as like your displaying popup
2) add below section to the manifest file
<activity android:name=".popupActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog">//====> this makes the activity to display like pop up when call make to this activity
when you call this activity through intent its look like what you require..
Please use custom Dialogue box and add some scrollview and linear layout into it. Then put your actual text into it.
You can use this android popup library with your custom layout. Very simple to use with one line of code in your activity.
Pop.on(this).with()
.title(R.string.title) //you can skip if you don't need title
.layout(R.layout.license).show();

Activity in dialog

I want to show an activity in dialog as shown in the picture below. Does any one know how can to achieve this result?
I tried using this code for that activity but it didn't help me.
android:theme="#android:style/Theme.Dialog"
It shows in middle of screen can I change its position ?
Instead of creating a new Activity with Theme.Dialog, I would suggest you to use Custom View to appear on that action and later hide it.
There are open source custom Views called as QuickAction.
Please have a look at this post.
And specially this git repo, pointed in the post linked in the accepted answer.

Dynamic custom ListView in custom Dialog

I need your help, cause I'm thinking about how to resolve this problem and don't know what's the best method:
What I have:
I have a standard ImageGallery. Below this, there is a Button.
What I want:
When I press this Button, there shall be opened a List of all the images, consisting of a small image on the left and a short description in one row, all the content should be brought by an array in an extra folder.
By clicking one row, the chosen image should appear in the Gallery and the list should be closed.
What I am thinking:
is, that I have to create a custom Dialog (Alert Dialog?Binder?), started by the Button. This Dialog must be filled with a custom ListView.
What I don't know:
What components of the framework do I need for this? I have found some things with Google, but at least I'm not sure what's the most efficient way.
I saw, that somebody had created an extra activity for the Dialog, using a DialogLayout.
Someone else tried it with a builder, another one with an AlertDialog.
Furthermore, I'm confused about the combining of the ListView, ArrayAdapter, Dialog, ViewBinder, getView, Objects and so on.
Someone has an idea how to resolve this on the easiest way?
You need to do something like this:
Define an activity extending ListActivity.You can refer this tutorial how to use listactivity.
Add this activity in your manifest file with theme attribute android:theme="#android:style/Theme.Dialog" in your activity tag which will make your activity look like a dialog.
You can start this activity on your button click.
If you want some result should be returned to your calling activity then use startActivityForResult().

Categories

Resources