Override default system volume button function globally

I need to redefine the keystroke of the system volume by default around the world, for example: if I turn the volume down while in the main home launcher, it will execute the same command as when the application starts.

+4
source share
1 answer

You need to write the intent “Increase audio volume” , which will allow your application to intercept the broadcast message. Then you can undo the original action (increase volume) and grab the button for your own needs. See the Android developer documentation for intent filters , such as code and additional information.

This tutorial must get you started to get started with BroadcastRecievers.

+3
source

Source: https://habr.com/ru/post/1369260/


All Articles