looking for some solutions? You are welcome.

SOLVED: Android activity has leaked window on progressdialog in a fragment

prashant kumar singh:

I am working on an app in which I implemented back navigation on device's back button. while I was testing this I noticed that my app is crashing sometimes when I tap the back button from any of my fragments to go my dashboard fragment. I checked the logcat it throws error as

DashboardActivity has leaked window com.android.internal.policy.PhoneWindow$DecorView{ff97ba0 V.E...... R......D 0,0-1026,348} that was originally added here

It gives error on in my dashboard fragments where I am using progressDialog.show(). This progress dialog is used when I am fetching data from server to prevent user interruptions and dismiss in onResponse of retrofit.

I am using an activity to hold my fragments, now I am confused how can I prevents this. I checked few other questions but all were based on activities here my error is in my fragment holded by an activity which crashes in the end. If anyone want me to add my backnavigation code I can.

Any help will be highly appreciated, THANKS !!

Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots

No comments: