大家好,我在学习用eclipse开发Android应用时,发现每个应用退出时都会提示以下内容,这是什么原因: “Activity com.stv.main.CheckUpdateActivity has leaked IntentReceiver [email protected] that was originally registered here. Are you missing a call to unregisterReceiver()?”
你好,在你的这个类里com.stv.main.CheckUpdateActivity注册了广播,必须在页面销毁时进行解注册,需要调用在onDesdroy()方法里调用unregisterReceiver()。
//实例
@Override
public void onDestroy() {
// TODO Auto-generated method stub
Log.i(TAG, "黑名单服务关闭");
unregisterReceiver(receiver);
super.onDestroy();
}
时间: 2024-08-24 01:37:13