Java 希望它也能起作用;)我昨天才弄明白。 this.getWindow().getDecorView().invalidate(); <application android:label="@string/app_name" android:icon=
希望它也能起作用;)我昨天才弄明白。Java 希望它也能起作用;)我昨天才弄明白。 this.getWindow().getDecorView().invalidate(); <application android:label="@string/app_name" android:icon=,java,android,Java,Android,希望它也能起作用;)我昨天才弄明白。 this.getWindow().getDecorView().invalidate(); <application android:label="@string/app_name" android:icon="@drawable/icon" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> this.getWindow().setFlags(WindowManager.L
this.getWindow().getDecorView().invalidate();
<application android:label="@string/app_name" android:icon="@drawable/icon" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN );
protected void onResume() {
super.onResume();
handler.postDelayed(new Runnable() {
public void run() {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
}, 1000);
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
/* Workaround a probable Android bug with fullscreen activities:
* on resume status bar hides and black margin stays,
* reproducible half of the time when coming back from lock screen
* (tested on HTC Wildfire)
* No idea why but this empty overload method fixed it.
*/
}
@Override
protected void onResume() {
Log.e("", "onResume");
super.onResume();
//this is a simple Splash with "Game paused" Text inside! in my main.xml
final LinearLayout gamePause_text = (LinearLayout) findViewById(R.id.gamePause_text);
OnGlobalLayoutListener asdf = new OnGlobalLayoutListener(){
public void onGlobalLayout() {
Log.e("", "onGlobalLayout");
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
gameSurface.onResume(); //OpenGL Surface onResume();
gamePause_text.getViewTreeObserver().removeGlobalOnLayoutListener(this);
};
gamePause_text.getViewTreeObserver().addOnGlobalLayoutListener(asdf);
}
<application
android:icon="@drawable/icon"
android:installLocation="auto"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >