开发者

Launch AlertDialog not from an Activity

I am trying to launch an alert dialog when not in a class that extends activity, but I am 开发者_运维问答on the GUI thread. I have access to my applications context and attempt to launch the alert dialog with that but get an error:

02-12 00:48:07.412: ERROR/AndroidRuntime(1322): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application

Does anybody know what I am doing wrong on this one?


You cannot launch a dialog except via an activity, sorry.

You are welcome to create an activity that uses Theme.Dialog or something to look a bit like a dialog, if you wish.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜