How To Make A Broadcast Receiver Catch ( Menu, Volume, Home....... ) Button Click?
Solution 1:
Yes it is possible but don't waste your time to build an application, which is based upon menu button(hardware buttons like HTC phones) as some phones don't support menu buttons instead they offer you touch like LG phones.
You can add functionality to Power button, Volume Buttons Up and Down.
Here is the tutorial for you as a newbie.
http://www.vogella.com/articles/AndroidBroadcastReceiver/article.html
I will recommend you to study Broadcast Receiver in detail before start writing your code!
One last thing, do Study the differences between API 10 or lower and API 11 or higher, Because there arises a problem when you run you API 10 based Android App on API 11 or higher.
Also See, - Pending Intents - sendBroadcast()
Solution 2:
Is that possible?
Generally, no. A couple of buttons, such as the CAMERA
button, will result in a broadcast, if the foreground activity does not consume the event. This is not true for the HOME button, or the MENU button (if one exists). I am not aware of broadcasts that are sent out for the volume buttons (if they exist), but I cannot rule out that there are some.
Post a Comment for "How To Make A Broadcast Receiver Catch ( Menu, Volume, Home....... ) Button Click?"