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">

CEO & Co-Founder at SolGuruz® | Organiser @ GDG Ahmedabad | Top 0.1% over StackOverflow | 15+ years experienced Tech Consultant | Helping startups with Custom Software Development

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