I want to pop up a Dialog from my Service when my App is running(so I do have my own Activity window that the user is viewing and operating at), but I always get android.view.WindowManager$BadTokenException:
08-05 20:47:39.432: ERROR/AndroidRuntime(1387): Uncaught handler: thread main exiting due to uncaught exception 08-05 20:47:39.432: ERROR/AndroidRuntime(1387): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application 08-05 20:47:39.432: ERROR/AndroidRuntime(1387): at android.view.ViewRoot.setView(ViewRoot.java:429) 08-05 20:47:39.432: ERROR/AndroidRuntime(1387): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:178) 08-05 20:47:39.432: ERROR/AndroidRuntime(1387): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) 08-05 20:47:39.432: ERROR/AndroidRuntime(1387): at android.app.Dialog.show(Dialog.java:231) 08-05 20:47:39.432: ERROR/AndroidRuntime(1387): at android.app.AlertDialog$Builder.show(AlertDialog.java:802) Is it because Service context can not serve Dialog? I haven't seen any doc mention that, though. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---