3

I am developing an android application which contains a full screen activity but i am unable to hide default android battery , time etc. icons from the screen

For example :- battery ,time etc icons are hidden within the view only

I think this is something like android immersive full screen view

So can any one tell me how can i achieve this

chiastic-security
  • 20,430
  • 4
  • 39
  • 67
Nishant Tanwar
  • 383
  • 4
  • 8
  • 18

2 Answers2

4

you can do it in java file by

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
    WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);

or in AndroidManifest.xml

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

With transparent notification bar read this link.

Community
  • 1
  • 1
Kushal Sharma
  • 5,978
  • 5
  • 25
  • 41
1

There is a new feature called Immersive FullScreen mode where all the UI elements other than your Activity are hidden. One can get those those back by swiping down. Use the following code to achieve this :

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN|View.SYSTEM_UI_FLAG_HIDE_NAVIGATION|View.SYSTEM_UI_FLAG_IMMERSIVE|View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);