无与伦比

Exception android.content.ReceiverCallNotAllowedException: IntentReceiver components are not allowed to bind to services

Exception android.content.ReceiverCallNotAllowedException: IntentReceiver components are not allowed to bind to services

BroadcastReceiver中bind Service出现上述异常,下面是官方解释。意思是在Broadcast中是不允许bindservice的

/**
* This exception is thrown from {@link Context#registerReceiver} and
* {@link Context#bindService} when these methods are being used from
* an {@link BroadcastReceiver} component. In this case, the component will no
* longer be active upon returning from receiving the Intent, so it is
* not valid to use asynchronous APIs.
*/

退出移动版