android:报Activity has leaked IntentReceiver或者re...

原因:
很可能是直接调用registerReceiver(......)和unregisterReceiver(......),导致这两个方法找不到。

解决办法:
在registerReceiver(......)和unregisterReceiver(......)直接调用改为:
getApplicationContext().registerReceiver(......)和getApplicationContext().unregisterReceiver(......)
 
 
-----------------------------
更多android精彩内容可以查阅我的网易博客:
http://songyuanlin1101.blog.163.com/
 
 

你可能感兴趣的:(android,receiver,leaked,IntentReceiver,registered)