This repository has been archived by the owner on May 15, 2024. It is now read-only.
[Bug] Incorrect CurrentActivity value after activities are destroyed and restored by the system #2075
Labels
bug
Something isn't working
Description
Steps to Reproduce
In our application we have two activities,
DialogActivity
is opened on top ofMainActivity
. We use Settings -> Developer Options -> Don't Keep Activities turned ON to simulate system high load. While top activity (DialogActivity
) is opened - minimize the app and then open it again.Expected Behavior
Platform.CurrentActivity
should return instance ofDialogActivity
Actual Behavior
Platform.CurrentActivity
returns instance ofMainActivity
Basic Information
Code snippet
Code: link
Logs: link
Looks like issue happens because paused activity also saved as current activity, which may override already resumed activity.
void Application.IActivityLifecycleCallbacks.OnActivityPaused(Activity activity) { Activity = activity; Platform.OnActivityStateChanged(activity, ActivityState.Paused); }
Seems like we don't need to update Activity when OnPause called
The text was updated successfully, but these errors were encountered: