android.content.ReceiverCallNotAllowedException: 解决方法

一、 android.content.ReceiverCallNotAllowedException: IntentReceiver components are not allowed to register to receive intents解决方法:

在Android开发中

1、bindService不能在BroadcastReceiver 中调用,你可以在里面调用StartService并把要传递参数放到intent中

2、registerReceiver不能在BroadcastReceiver调用,可以通过context.getApplicationContext().registerReceiver();解决,我测试成功

其他的android.content.ReceiverCallNotAllowedException也可以通过context.getApplicationContext(),不过我没有测试。

posted @ 2014-05-14 12:57  mhx_pyw  阅读(604)  评论(0编辑  收藏  举报