Android – Hide Title bar and Notification bar

By -



Hi,

Here i am going to discuss about on making activity full-screen by hiding Title bar and notification bar from the activity.  So question here is:

Android – How do we hide Title bar?

//write before setContentView()
this.requestWindowFeature(Window.FEATURE_NO_TITLE);

Android – How do we hide Notification bar?

//write before setContentView()
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

OR

And yes, we can achieve the same by defining attribute value inside the AndroidManifest.xml file:

<activity android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
Paresh Mayani

Lazy android developer, exploring the horizon of android development since 7 years, currently working as a Technical Lead - Android at Simform Solutions, India. Former Application Architect at KarConnect. He is the Head/Organizer of Google Developers Group (GDG), Ahmedabad

Loading Facebook Comments ...
Loading Disqus Comments ...