java - Identify volume button press and release in android -
in android app want 2 notification separately , when press volume button , release it. using below method can identify volume button press event .
public boolean onkeydown(int keycode, keyevent event) { switch (keycode) { case keyevent.keycode_volume_down: { toast.maketext(getbasecontext(), "volume down button pressed", toast.length_short).show(); return true; } case keyevent.keycode_volume_up: toast.maketext(getbasecontext(), "volume button pressed", toast.length_short).show(); return true; } return super.onkeydown(keycode, event); }
now want know how can identify volume button release event. if aware please guide me.
Comments
Post a Comment