I am making a lock screen app for android and so it requires that both the notification bar and home button be disabled. Since ICS and further versions do not allow disabling of the Home button, is there a way to do it in the previous versions?
Asked
Active
Viewed 1,135 times
2 Answers
0
You can add this snippet to your Activity:
@override
public void onAttachedToWindow()
{
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
super.onAttachedToWindow();
}
But will not work in ICS and jelly bean and will give you crash in app.For more details see these references:
Android - Is It possible to disable the click of home button
What does this 4 line java code means in android application?

Community
- 1
- 1

hasanghaforian
- 13,858
- 11
- 76
- 167