Bob Last
Bob Last

Reputation: 83

Android pop up list dialog

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 thisenter image description here

I want it to display a list of message like this enter image description here 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.

Upvotes: 1

Views: 3885

Answers (2)

codeMagic
codeMagic

Reputation: 44571

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"

Upvotes: 1

Sourabh Saldi
Sourabh Saldi

Reputation: 3587

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

Upvotes: 2

Related Questions