Reputation: 73
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
Upvotes: 0
Views: 261
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