Restrict Broadcast Receiver to application

前端 未结 3 1631
无人及你
无人及你 2021-01-14 21:51

I am working on broadcast receiver and stuck in a problem.

I am receiving a broadcast receiver in Manifest file.



        
3条回答
  •  再見小時候
    2021-01-14 22:32

    What you are talking is not possible. The whole purpose of having the intent filter in the manifest is being able to receive the intent whether or not your application is running. The only way to do what you want to is by registering/unregistering the receiver from the code [registerReceiver]

提交回复
热议问题