i create a lockscreen application and i need to disable a home button, so if that phone is stolen, that phone can\'t be accessed.. my lockscreen is a fullscreen activity.. i
In my Samusung Pocket, nothing above worked fine. I could make it finally after further search.
I put full screen them in your AndroidMainfest.xml like following (not in Acitivity code):
And use keygurad onAttachedToWindow() method in your activity:
@Override
public void onAttachedToWindow() {
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
KeyguardManager keyguardManager = (KeyguardManager) getSystemService(KEYGUARD_SERVICE);
KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
lock.disableKeyguard();
}
Exactly what I have wanted. Blocking HOME button and same after turning off/on.