How to disable all hardware keys programatically in android?
Posted
by
Raghu Rami Reddy
on Stack Overflow
See other posts from Stack Overflow
or by Raghu Rami Reddy
Published on 2012-12-01T10:37:29Z
Indexed on
2012/12/01
11:04 UTC
Read the original article
Hit count: 295
android
|android-hardware
I am developing android application with lock functionality. please suggest me how to disable all the hard keys programatically. here i am using beleow code to disable back button. i want like this functionality for all hard keys like home,search,camera, shortcut keys here is my code:
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_SEARCH) {
Log.d("KeyPress", "search");
return true;
}
return false;
}
Thanks in advance.
© Stack Overflow or respective owner