Why is my BroadCast Receiver not working?

前端 未结 6 992
礼貌的吻别
礼貌的吻别 2021-01-21 16:03

I am learning about BroadCast Receivers. What I am trying to achieve with the following piece of code is, I would like to see a toast when I switch to airplane mode, where the a

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-21 17:01

    The Official document of Broadcast Receivers Says:

    android:exported
    

    Whether or not the broadcast receiver can receive messages from sources outside its application — "true" if it can, and "false" if not. If "false", the only messages the broadcast receiver can receive are those sent by components of the same application or applications with the same user ID.

提交回复
热议问题