3

I want to hide status bar ( Syste UI ) in my application and i want to show navigation bar always. From android developer docs i got this code to get full screen.

int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

it will hide navigation and status bars both.

SYSTEM_UI_FLAG_HIDE_NAVIGATION, this flag hides the navigation bar. but i want to hide only status bar and show navigation bar always.. please tell me what flags are required to do this.

EDIT : I want to do this in Kindle tab (6 inch tab ). View.SYSTEM_UI_FLAG_FULLSCREEN this tag hiding both bars. but i want to hide only status bar.. show navigation bar always.

RajaReddy PolamReddy
  • 22,428
  • 19
  • 115
  • 166

2 Answers2

0

enter image description herePut below code in your manifest file for that particular activity:

android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen"

OR

android:theme="@android:style/Theme.NoTitleBar"

Style.xml

<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
        <!--
            Theme customizations available in newer API levels can go in
            res/values-vXX/styles.xml, while customizations related to
            backward-compatibility can go here.
        -->
    </style>

     <style name="Theme.AppCompat.Light.NoActionBar.FullScreen" parent="@style/Theme.AppCompat.Light">
    <item name="android:windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
    </style>
Sagar Maiyad
  • 12,655
  • 9
  • 63
  • 99
-1

Follow this code,

public class ActivityName extends MyActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);     
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
        WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.main);
}
}
Krunal Indrodiya
  • 782
  • 2
  • 7
  • 19