You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Issue
The LoginActivity is being leaked if the progress dialog is visible during a configuration change. Here is the stacktrace that is thrown:
WindowManager E android.view.WindowLeaked: Activity com.woocommerce.android.ui.login.LoginActivity has leaked window DecorView@a0f7aaf[] that was originally added here
E at android.view.ViewRootImpl.<init>(ViewRootImpl.java:485)
E at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:346)
E at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
E at android.app.Dialog.show(Dialog.java:330)
E at android.app.ProgressDialog.show(ProgressDialog.java:185)
E at org.wordpress.android.login.LoginBaseFormFragment.startProgress(LoginBaseFormFragment.java:219)
E at org.wordpress.android.login.LoginEmailPasswordFragment.next(LoginEmailPasswordFragment.java:213)
E at org.wordpress.android.login.LoginEmailPasswordFragment$2.onClick(LoginEmailPasswordFragment.java:164)
E at android.view.View.performClick(View.java:6294)
E at android.view.View$PerformClick.run(View.java:24770)
E at android.os.Handler.handleCallback(Handler.java:790)
E at android.os.Handler.dispatchMessage(Handler.java:99)
E at android.os.Looper.loop(Looper.java:164)
E at android.app.ActivityThread.main(ActivityThread.java:6494)
E at java.lang.reflect.Method.invoke(Native Method)
E at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
E at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Steps to Reproduce
Install a fresh version of the app (or logout)
Login with email, then enter password and hit next - the progress dialog will show
Immediately change the orientation of the device
Observe error in the logs
Recommended Fix
Dismiss the dialog and drop the reference, for example in LoginBaseFormFragment:
@Override public void onDestroyView() {
if (mProgressDialog != null) {
mProgressDialog.dismiss();
mProgressDialog = null;
}
super.onDestroyView();
}
Note: I recommend using mProgressDialog.dismiss() instead of mProgressDialog.cancel() to avoid doing unnecessary work defined in the OnCancelListener.
The text was updated successfully, but these errors were encountered:
The Issue
The LoginActivity is being leaked if the progress dialog is visible during a configuration change. Here is the stacktrace that is thrown:
Steps to Reproduce
Recommended Fix
Dismiss the dialog and drop the reference, for example in
LoginBaseFormFragment
:Note: I recommend using
mProgressDialog.dismiss()
instead ofmProgressDialog.cancel()
to avoid doing unnecessary work defined in theOnCancelListener
.The text was updated successfully, but these errors were encountered: