Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android fullscreen activity without battery icon

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

like image 985
Nishant Tanwar Avatar asked Nov 26 '25 03:11

Nishant Tanwar


2 Answers

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.

like image 127
Kushal Sharma Avatar answered Nov 27 '25 17:11

Kushal Sharma


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);
like image 20
Chakradhar Reddy Veeramreddy Avatar answered Nov 27 '25 18:11

Chakradhar Reddy Veeramreddy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!