Android: use FLAG_FULLSCREEN and TYPE_KEYGUARD together

I am trying to make an Android Tablet app for presentations at trade fairs, etc. I don't want to upload the app to the app store, but only use it on my tablet.

I am trying to start an application in full screen (no status bar) with

requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);

      

Works great. I am trying to disable the home button with:

@Override
public void onAttachedToWindow() {
    super.onAttachedToWindow();
    this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);           
}

      

in my OnCreate method. Works great.

But if I try to use both in the same app, only disabling the home button still works, any idea what I can do about this?

Thank!

+3


source to share


1 answer


Try to declare the action as full screen in AndroidManifest.xml and then do what you already did to grab the home button



<activity android:name="..." android:label="..."
    android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />

      

0


source







All Articles