tags:

views:

44

answers:

1

I have an issue with the following code:

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                     WindowManager.LayoutParams.FLAG_FULLSCREEN);

On my emulator this seems to work fine. The status bar disappears and the empty space is filled with the content view. However on my Nexus One this sometimes works and sometimes the empty space remains empty/black.

Any idea why this happens?

I tried to counteract this, but my naive approach wasn't fruitful:

handler.postDelayed(new Runnable() {

             @Override
             public void run() {
                 v.getRootView().invalidate();
                 v.getRootView().requestLayout();
                 v.getRootView().forceLayout();

             }
         }, 800);
}

I tried those things from above separately, synchronously and delayed (to wait for the hide animation to end first).

A: 

Are you talking about the title bar? I would use the windowNoTitle theme instead of doing it in code:

<style name="MyTheme" parent="android:Theme.Black">
  <item name="android:windowNoTitle">true</item>
</style>
Brandon
Seu,that would not allow to me toggle into and out of the full screen mode. But that's what I want.
Mariano Kamp