Repository navigation
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that when a fragment is destroyed, the stored resume callback is invoked after disconnecting, restoring any necessary UI state (e.g., tabs on a TabbedPage).
- Cache and invoke the
_onResumecallback afterOnFragmentDestroyed - Ensures tabs reappear when a modal is popped in the background
Comments suppressed due to low confidence (2)
src/Core/src/Platform/Android/FragmentManagerExtensions.cs:121
- [nitpick] The variable name
resumeis a bit generic. Consider renaming it toresumeCallbackor similar to clarify its purpose.
var resume = _onResume;
src/Core/src/Platform/Android/FragmentManagerExtensions.cs:123
- Add automated tests in both TestCases.HostApp and TestCases.Shared.Tests to verify that the
_onResumecallback is invoked and that tabs are correctly restored when a modal is popped.
resume?.Invoke(fm);
|
Hey there @@kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
jsuarezruiz
left a comment
There was a problem hiding this comment.
Could you include a related Test?
In an UITest can move the App to background using App.BackgroundApp(); and restore it to foreground using App.ForegroundApp();
|
I believe #30290 already fixes this and also fixes the issue related with tabs being removed during modal navigations |
|
Closing this PR in favor of #30290 Calling code that expects to run during resume from ondestroy feels risky If this is an approach we want to where code will run regardless if the fragment is destroyed or not then we should probably add an additional overload for the method that takes an action like "RunOnResumeOrDestroy" |
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
This is an extension of PR #19532
Issues Fixed
Fixes #22444
Screen.Recording.2025-07-06.at.19.58.02.mov
Screen.Recording.2025-07-06.at.19.56.43.mov