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.
*/

0 条评论
发表一条评论

注意: 评论者允许使用'@user空格'的方式将自己的评论通知另外评论者。例如, ABC是本文的评论者之一,则使用'@ABC '(不包括单引号)将会自动将您的评论发送给ABC。使用'@all ',将会将评论发送给之前所有其它评论者。请务必注意user必须和评论者名相匹配(大小写一致)。