3

I've noticed some odd behavior on the recent apps screen on Android that I can't find an explanation for anywhere. When I open apps on a phone while in landscape view and switch to the recent apps screen all I see is a white square for that app, no preview thumbnail.

This is how it looks on a OnePlus 6 when I open Chrome in portrait mode and open the recent apps screen

But when I open Chrome while in landscape and then go to the recent apps screen I get this

And similar behavior on a Pixel 3:

Opening Chrome in portrait and switching to recent apps

Opening Chrome in landscape and switching to recent apps

If I give the Pixel 3 some time it will eventually generate a thumbnail for the landscape app though about half the time it looks squished like this and the other half it isn't up to date with what was actually being shown on the screen.

My question is why does Android seem to struggle with generating landscape preview thumbnails for the recent apps screen? Has anyone else experienced this behavior or know of a fix for it?

1

As an Android developer, the only thing I can be sure of is that configuration changes force the activity to be restarted. This includes screen orientation (portrait, landscape), so Chrome has to be destroyed and recreated, returning a blank/stale landscape content instead.

From Android Developers - Handle configuration changes

Handle configuration changes

Some device configurations can change during runtime (such as screen orientation, keyboard availability, and when the user enables multi-window mode). When such a change occurs, Android restarts the running Activity ( onDestroy() is called, followed by onCreate()). The restart behavior is designed to help your application adapt to new configurations by automatically reloading your application with alternative resources that match the new device configuration.

To properly handle a restart, it is important that your activity restores its previous state. [...]

(Also, list of configuration changes)

I cannot reproduce this issue on my device*, but from the screenshots, the recent list is always shown in portrait mode, so there is a change from landscape to portrait between triggering the "recent apps list" event and showing it. I'm not sure about the order of the events for screen rotated, app destroyed, and app recreated, but most possibly it is destroyed-rotated-recreated, thus the app is not ready yet to re-render the activity (since an activity also cannot run while on the background), returning a blank white screen or use its previous state (the stale landscape content) instead.

The "fix" ― if it is possible ― is to allow showing "recent apps list" in landscape mode.


*The reason I cannot reproduce this issue is that my device allows showing "recent apps list" in landscape mode, so the thumbnail is shown correctly. However, when I rotate to portrait while on the list, the thumbnail will be shown squished as the screenshot.

Also, the restart may be observed more easily by rotating the screen while Chrome is active: after the rotation, Chrome will re-render the content to current available space.

Lastly, I do not know why the recent apps list is forced on portrait mode, but that is out of the question's scope.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.