java - Android capturing volume up/down key presses in broadcast receiver? -
java - Android capturing volume up/down key presses in broadcast receiver? -
i'm trying create application user can override default behaviour of volume up/down buttons (as screen on/off button - possible?). anyways, using code along lines of next can this:
@override public boolean onkeydown(int keycode, keyevent event) { super.onkeyup(keycode, event); if ((keycode == keyevent.keycode_volume_up)) { //this can stuff homecoming true; //because handled event } homecoming false; //otherwise scheme can handle }
but possible when application not open, hence why i'd set broadcast receiver or maybe stick in service create possible.
thanks help.
as screen on/off button - possible?
fortunately, no.
but possible when application not open, hence why i'd set broadcast receiver or maybe stick in service create possible.
this not possible volume buttons.
for example, andross allows override photographic camera hardware button take screenshot.
that photographic camera button. if foreground activity not consume photographic camera button click, gets turned broadcast intent, other applications can hear for. behavior unique photographic camera , media buttons , not used other hardware buttons.
java android broadcastreceiver
Comments
Post a Comment