//写在Present类中 自定义方法名
public void onBindDestory(){ if(loginView!=null){ loginView=null; } } //在loginpresenter接口中定义一个方法写在 view层类中void onBindDestory();
对应Presenter 中的这个方法
@Overrideprotected void onDestroy() {
super.onDestroy();
//如果loginpresenter 不为空 就调用其中的方法 进行解绑
if(loginpresenter!=null){
loginpresenter.onBindDestory();
}
}