Skip to content

[Bug] Android frames are missing from frame stack after backpress and app resume #11436

Description

@CatchABus

Issue Description

In android 12 and later, root launcher activities are no longer finished on Back press.
See https://developer.android.com/about/versions/12/behavior-changes-all#activity-lifecycle

However, {N} core overrides backpress and removes frames from stack, thinking that the activity will finish.
Then, user attempts to launch the app and it will simply resume without recreating views and frames will still be missing from the stack.

That is because the frame stack implementation is very old and did not consider the more recent android 12 behaviour.
The issue affects Frame.topmost() and Frame.getFrameById().

This can be replicated in apps with multiple frame instances as back press makes sure core keeps at least a single frame in the stack.

Reproduction

  1. Launch an app with a frame that has an id in android 12 or later
  2. Log result from Frame.getFrameById(id) which should print the frame view
  3. Press back to close application
  4. Launch app again and it will still be in the last navigated page
  5. Log result from Frame.getFrameById(id) and it will be undefined

Relevant log output (if applicable)

Environment

No response

Please accept these terms

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-pending-triageReported bug, pending triage to confirm.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions