4

when i change my activity to fullscreen, the statusbar performs an animation,but not disappear immediately. so how can i make the statusbar disappear immediate ? if need to change framework , where is it?

Michael Easter
  • 23,733
  • 7
  • 76
  • 107
Mitul Nakum
  • 5,514
  • 5
  • 35
  • 41

2 Answers2

3

try android:theme="@android:style/Theme.NoTitleBar.Fullscreen" in the activity tag in your manifest file.

Edit:

Use requestWindowFeature(Window.FEATURE_NO_TITLE) in your onCreate() before you call setContentView () to set programmatically.

Vineet Shukla
  • 23,865
  • 10
  • 55
  • 63
  • Please read question again "when i change my activity to fullscreen". I know how to set above flags. after setting above flags it shows animation to hide, not immediately. – Mitul Nakum Feb 17 '12 at 05:50
  • 1
    @VineetShukla But it will not Help For Activity Which is declare as SingleInstance ,Means For First It will Work well ,but when we gain use Activity it will show status bar for Some Moment. – Herry Feb 17 '12 at 06:17
2

I have found solution.

we can out following code in activity from which we are creating and starting Intent

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Intent scanIntent = new Intent(this, SecondActivity.class);
startActivity(scanIntent);

By this it will hide status bar first then it will move to next activity.

Above code will require only when you are using single instance for second activity. else you can apply solution given by Vineet Shukla

Mitul Nakum
  • 5,514
  • 5
  • 35
  • 41