Android - Broadcast Receiver not being fired

后端 未结 2 1570
花落未央
花落未央 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:36

    I do not know if this is your problem but you should definitelly try this:

    Instead of ".MessageReceiver" put android:name = "com.encima.smsreceiver.MessageReceiver"

    This is fix that workout many times for me when something doesn't get called.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题