Android Question Volume changed

Almog

Active Member
Licensed User
hello,

It is possible for action to happen when the volume is changed not by (my) app?
for example, when the user click on volume up button, a message box will pop up? (whether the app is open or closed)?

Thanks in advance.
 

ronell

Well-Known Member
Licensed User
when you're in the app. yes it is simple
without the app in foreground.. try using service to intercept and consume the event ( dont know if it is possible )
 

Computersmith64

Well-Known Member
Licensed User
You should be able to do it with a Broadcast Receiver that handles the ACTION_MEDIA_BUTTON intent. There is a Broadcast Receiver tutorial here. You should be able to find out more about ACTION_MEDIA_BUTTON intents by asking Mr Google.

- Colin.
 

Almog

Active Member
Licensed User
when you're in the app. yes it is simple
without the app in foreground.. try using service to intercept and consume the event ( dont know if it is possible )
You should be able to do it with a Broadcast Receiver that handles the ACTION_MEDIA_BUTTON intent. There is a Broadcast Receiver tutorial here. You should be able to find out more about ACTION_MEDIA_BUTTON intents by asking Mr Google.

- Colin.
Thank you
 
Top