How to set permissions in broadcast sender and receiver in android

后端 未结 5 1268
轮回少年
轮回少年 2020-12-04 09:46

How do we specify in broadcast sending application that which application can receive this broadcast, and in receiving application that which particular application has the

5条回答
  •  一向
    一向 (楼主)
    2020-12-04 10:41

    use an intent filter in receiver tag in manifest

     
        
            
            
        
    
    

    To send broadcast to app

       Intent intent = new Intent();
       intent.setAction("use same action in receiver");
       intent.addcategory("use same category in receiver");
       context.sendBroadcast(intent); 
    

提交回复
热议问题