user2164422
user2164422

Reputation: 91

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?

Upvotes: 9

Views: 3355

Answers (1)

KR_Android
KR_Android

Reputation: 1159

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);
    }
});

Upvotes: 9

Related Questions