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
- Launch an app with a frame that has an
id in android 12 or later
- Log result from
Frame.getFrameById(id) which should print the frame view
- Press back to close application
- Launch app again and it will still be in the last navigated page
- Log result from
Frame.getFrameById(id) and it will be undefined
Relevant log output (if applicable)
Environment
No response
Please accept these terms
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()andFrame.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
idin android 12 or laterFrame.getFrameById(id)which should print the frame viewFrame.getFrameById(id)and it will be undefinedRelevant log output (if applicable)
Environment
No response
Please accept these terms