1

I am coding a custom lockscreen app for android.

I have managed to disable the back button. But the home button and the recent apps button on ICS proved not to be as easy.

I searched around and came up with:

@Override
public void onAttachedToWindow() {
    // TODO Auto-generated method stub
    this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
    super.onAttachedToWindow();
}

However, this throws IllegalArgumentException window type can not be changed after it is added. I then tried to set it in onCreate() but the home key still functions.

I am willing to use root methods to achieve this. Is there any way to get it done?

Any help would be appreciated!

Kara
  • 6,115
  • 16
  • 50
  • 57
kevdliu
  • 1,709
  • 4
  • 29
  • 46
  • I'm more than sure you'd need root access and some low-level coding to do that. In other words, the Android SDK doesn't offer any way to do this. – mrres1 Oct 02 '12 at 01:54
  • yeah WidgetLocker does this really well with root helper. But i just cant seem to find how – kevdliu Oct 02 '12 at 02:51

1 Answers1

1

For android versions above 2.3, overriding of the Home button is disabled

kevdliu
  • 1,709
  • 4
  • 29
  • 46