Question

I'm working on Android 4.1 and application must run on Piranha Ultra III Tab 10.1.

I'll use http://developer.android.com/design/get-started/ui-overview.html for naming reference for my question; Status bar and navigation bar...

I tried too many things

Mostly founded on Google and Stackoverflow is;

1)

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

This code just disabled status bar but not navigation bar.

2)

I tried Google's fullscreen example. That project hid both navigation bar and status bar but everytime when I tap or any gesture movement, navigation bar is shown. I wrote events for gestures and every gesture movement, I tried to hid again but didn't work too..

3)

http://developer.android.com/reference/android/view/View.html#setSystemUiVisibility%28int%29

I tried this too but same as Google's fullscreen example...

int newVis = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;

newVis |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;

newVis |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE;

newVis |= View.SYSTEM_UI_FLAG_LOW_PROFILE;

newVis |= View.SYSTEM_UI_FLAG_FULLSCREEN;

newVis |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;

// newVis |= View.SYSTEM_UI_FLAG_IMMERSIVE;

v.setSystemUiVisibility(newVis);

Also I tried Samples with XML (style / layout / manifest) but no result...

Is there any other way to doin' this ?

Was it helpful?

Solution

If you hide the navigation buttons, Android force them to reappear on every interaction, because you don't want your users to be locked out in your app.

See this.

As far as I know, Android doesn't allow you to hide "permanently" (with or without gestures to pop it up again, except for Immersive Mode) the navigation bar, or maybe with root...

OTHER TIPS

Try this in your manifest under the activity you want

<activity
    android:name="your activity"
    android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen" >
</activity>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top