Question

Environment: android platform; Maybe you know that the command of "getevent" can output the events got from "/dev/input/eventX". Some devices have virtual keys like back, menu, home etc, and these keys implement also through touch screen. So how can i map the touch screen event at the virtual key area to right key event(back->back, home->home, menu->menu etc).

Was it helpful?

Solution

Back:

@Override
public void onBackPressed() {
    //Do stuff
}

Menu:

@Override
public boolean onCreateOptionsMenu(Menu menu) {
}

Home: Impossible

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top