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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -