Android - Broadcast Receiver not being fired

后端 未结 2 1569
花落未央
花落未央 2021-01-16 08:20

I know this has been asked ALOT on here, but I have been scouring the interwebs for hours and I have even reused some of my previous code for receiving sms\' and I got...not

2条回答
  •  离开以前
    2021-01-16 08:40

    Because the SMS broadcast intent is sent by Context.sendOrderedBroadcast(...), if any other app registers the BroadcastReceiver and calls abortBroadcast, the other receiver will not get the broadcast.

    To increase the probability of your app receiving the broadcast create an IntentFilter, use IntentFilter.setPriority.

提交回复
热议问题