mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
If page.parent is already the same frame - don’t add page to frame. This happens if activity is recreated. (#4096)
This commit is contained in:
@@ -53,7 +53,11 @@ function onFragmentShown(fragment: android.app.Fragment) {
|
||||
|
||||
const isBack = currentNavigationContext ? currentNavigationContext.isBackNavigation : false;
|
||||
|
||||
frame._addView(page);
|
||||
// When cachePagesOnNavigate is true and activity is recreated
|
||||
// we add pages to frame in fragment.onCreateView so no need to add them again.
|
||||
if (page.parent !== frame) {
|
||||
frame._addView(page);
|
||||
}
|
||||
|
||||
// onFragmentShown is called before NativeActivity.start where we call frame.onLoaded
|
||||
// We need to call frame.onLoaded() here so that the call to frame._addView(page) will emit the page.loaded event
|
||||
|
||||
Reference in New Issue
Block a user