I´m new to android development and I´m trying to make an app.
What I want to know is if is it possible to get key events even when the phone is locked?
For example to make my music player change the music when I press the DPAD_CENTER_BUTTON
Doing something like this:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_ENTER:
{
//your Action code
return true;
}
}
return super.onKeyDown(keyCode, event);
}
Is that possible?