Luke Taylor
Luke Taylor

Reputation: 9599

Android status bar stays

In my onCreate() method, I use this code to remove the status bar:

// Remove the status bar from the top
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

Yet when I start up the app, I can still see the status bar for like a second. How can I prevent this?

Upvotes: 0

Views: 236

Answers (2)

Dheeresh Singh
Dheeresh Singh

Reputation: 15701

you must use requestWindowFeature before setting the content view

Upvotes: 1

MRD
MRD

Reputation: 7184

Add the following attribute to the activity in the manifest:

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

Upvotes: 1

Related Questions