When using setContentView, I see the system wallpaper for a second
I'm switching a contentView
to fullscreen mode, and when the view is being switched, I'm able to see the system wallpaper for a couple sections开发者_开发技巧, before the view is actually changed, and vice versa when going back to the main
content view.
How can I get this to not happen, or at least how can I change the background to be black while it's being switched.
Sample code:
setContentView(R.layout.fullscreen);
I use this when setting the content view to fullscreen, which is where the problem shows up.
* EDIT *
At the very first of the application, I set the content to main:
super.onCreate(b);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.setContentView(R.layout.main);
And then on button click listener, I am setting it to a different layout like this:
setContentView(R.layout.fullscreen);
I don't why you are having this issue. By the way, if you're trying to get a full-screen activity you can try something like:
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
And use just an "ordinary" layout for your activity.
精彩评论