Execute code when user changes to silent mode in Android

后端 未结 3 1213
离开以前
离开以前 2021-01-29 03:15

I\'m using a service. In that service my code should get executed when the user changes to silent mode, i.e. as soon as the user changes to silent mode, my code needs to get exe

3条回答
  •  抹茶落季
    2021-01-29 03:36

    In your manifest file you can register the intent like this

    
    
                    
                              
    

    And then recieve the intent at method

    public void onReceive(Context context, Intent intent) 
    

    of class that extends BroadcastReceiver class

提交回复
热议问题