Derrick Feehi
Derrick Feehi

Reputation: 73

android.view.WindowLeaked(Progress dialog is leaking to new activity)

I have got this code in my Async task to go to a new activity when doInBackgound is completed, but no matter what I do, I always get the window leak error, I have also tried adding delay to the the progress bar, but with no success. Can anyone help me? Thanks

enter image description here

Upvotes: 0

Views: 261

Answers (1)

Rene Ferrari
Rene Ferrari

Reputation: 4206

Problem is your Activity is finished and the ProgressDialog is theoretically still "displaying" which is not possible (since the Activity where it is displayed is gone), hence this error occurs. To prevent it remove the Handler around the dialog dismiss then it should work :)

Upvotes: 1

Related Questions