views:

255

answers:

3

I am trying to create a small pop-up in my Android application to let the user choose from one of many items, ala a ListView. I am hoping to make it show up as a translucent box that overlays on the screen, as opposed to completely occupying it like Activities usually do.

One technique for doing this that I've heard is possible is to launch an Activity in an AlertDialog box. This would be perfect - it's the ideal size and has a lot of the mechanical properties I'm looking for, but I'm totally unable to find any more specifics of this technique.

Is this possible? And if not, what is the preferred way of accomplishing something like this?

+2  A: 

This should answer your question: http://developer.android.com/guide/topics/ui/themes.html

Quote: For example, you can use the Dialog theme to make your Activity appear like a dialog box. In the manifest, reference an Android theme like so:

<activity android:theme="@android:style/Theme.Dialog">
Aleksander Kmetec
This worked fantastic! Thank you very much!
YYY
A: 

Or try to put

Intent i = new Intent(this, MyClass.class);
startActivity(i);

in your onClick() method.. should work..

Jayomat
A: 

Maybe you could just display AlertDialog http://developer.android.com/guide/topics/ui/dialogs.html

Fedor