Android BroadcastReceiver without intent filters

前端 未结 2 2226
情深已故
情深已故 2021-02-19 20:28

I saw in few android ad networks sdks that they are declaring BroadcastReceiver with no intent filters. Something like this:



        
相关标签:
2条回答
  • 2021-02-19 21:14

    I think that the following question/answer should give you some clues:

    Create an IntentFilter in android that matches ALL intents

    0 讨论(0)
  • 2021-02-19 21:30

    If you do not have some intent filters, the only way to receive something is to call the receiver explicitly. This would look like this:

    context.sendBroadcast(new Intent(context, MyBroadcastReceiverClass.class));
    

    Another guy already answered this question in the following post: https://stackoverflow.com/questions/10051256/broadcast-receiver-not-receiving

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