javamail - "android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application" -


i want show alertdialog when send mail. have exception. windowmanager$badtokenexception mean?

pdialog = progressdialog.show(mainactivity.scontext , "", "sending mail...", true);      retreivefeedtask task = new retreivefeedtask(); 

as far can understand question problem trying update ui on different thread, , isn't possible. retreivefeedtask executing on different thread.

you have run code dispay alertdialog on ui thread. can pasting following code in own code , add code in body of method run().

activity.runonuithread(new runnable() {   public void run() {    } } 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -