android activity has leaked window com.android.internal.policy.impl.phonewindow$decorview Issue

后端 未结 8 738
再見小時候
再見小時候 2020-11-28 05:56

I am working with Android application to show network error.

NetErrorPage.java

package exp.app;

import android.app.Activity;
impor         


        
相关标签:
8条回答
  • 2020-11-28 06:27

    The way I got around this issue is by not calling intent within a dialog. **** use syntax applicable to activity or fragment accordingly

    @Override
    public void onClick(DialogInterface dialog, int which) {
        checkvariable= true;
        getActivity().finish();
    }
    
    @Override
    public void onStop() {
        super.onStop();
        if (checkvariable) {
            startActivity(intent); 
        }
    }
    
    0 讨论(0)
  • 2020-11-28 06:29
     @Override
        protected void onPostExecute(final Boolean success) {
            mProgressDialog.dismiss();
            mProgressDialog = null;
    

    setting the value null works for me

    0 讨论(0)
提交回复
热议问题