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

后端 未结 8 808
再見小時候
再見小時候 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); 
        }
    }
    

提交回复
热议问题