开发者

Is it possible to launch an Android Activity from an AlertDialog?

开发者 https://www.devze.com 2022-12-12 18:07 出处:网络
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 sc

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. T开发者_如何学编程his 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?


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">


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

0

精彩评论

暂无评论...
验证码 换一张
取 消