解决mvp内存泄漏

pesenter实现类中写一个对外方法

public void destory(){
       iView=null;
    }

activity里写

@Override
    protected void onDestroy() {
        super.onDestroy();
        if(iPesenter!=null){
           iPesenter.destory();
        }
    }

猜你喜欢

转载自blog.csdn.net/Android_1Student/article/details/82798427