Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

status bar flicker when exiting fullscreen activity

I noticed a pretty irritating flicker that happens in the following scenario: display a fullscreen activity and then launch another activity that is not fullscreen.

In my app I use an action bar at the top of the second activity and I clearly see how a flickering is done when switching between the activities.

When the status bar appears, it doesn't smoothly push my activity down, but very quickly and with this annoying flicker.

Is there some API I can use to control this behaviour? Or some other workaround?

like image 579
user2164422 Avatar asked Mar 13 '13 08:03

user2164422


1 Answers

I had same issue. Below workaround fixed it, put this code before finishing your first activity.

Handler handler = new Handler();
handler.post(new Runnable() {
    @Override
    public void run() {
        YourActivity.this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    }
});
like image 134
KR_Android Avatar answered Oct 15 '22 09:10

KR_Android