How to mesure how long ex. volume up key has been pressed in DialogFragment?
Unfortunately DialogFragment
doesn't have methods onKeyUp, onKeyDown
. :((
So who (which object) receives by default information about pressed keys?
I've learnt that I can use getDialog().setOnKeyListener(this)
assuming that my class implements OnKeyListener
.
Great but then I have the following method:
@Override
public boolean onKey(DialogInterface arg0, int arg1, KeyEvent arg2) {
// TODO Auto-generated method stub
return false;
}
But I need onKeyDown, onKeyUp
(with possibility to call event.startTracking()
How to achieve this? How to mesure how long ex. volume up key has been pressed (in DialogFragment
)?