diff --git a/nativescript-core/ui/frame/frame-common.ts b/nativescript-core/ui/frame/frame-common.ts index ad5c67b8a..37b8b12c4 100644 --- a/nativescript-core/ui/frame/frame-common.ts +++ b/nativescript-core/ui/frame/frame-common.ts @@ -70,12 +70,12 @@ export class FrameBase extends CustomLayoutView implements FrameDefinition { const top = FrameBase.topmost(); if (top && top.canGoBack()) { top.goBack(); - + return true; } else if (top) { let parentFrameCanGoBack = false; let parentFrame = getAncestor(top, "Frame"); - + while (parentFrame && !parentFrameCanGoBack) { if (parentFrame && parentFrame.canGoBack()) { parentFrameCanGoBack = true; @@ -83,18 +83,18 @@ export class FrameBase extends CustomLayoutView implements FrameDefinition { parentFrame = getAncestor(parentFrame, "Frame"); } } - + if (parentFrame && parentFrameCanGoBack) { parentFrame.goBack(); - + return true; } } - + if (frameStack.length > 1) { top._popFromFrameStack(); } - + return false; } @@ -216,11 +216,11 @@ export class FrameBase extends CustomLayoutView implements FrameDefinition { traceWrite(`NAVIGATE`, traceCategories.Navigation); } + this._pushInFrameStack(); + const entry = buildEntryFromArgs(param); const page = Builder.createViewFromEntry(entry) as Page; - this._pushInFrameStack(); - const backstackEntry: BackstackEntry = { entry: entry, resolvedPage: page, diff --git a/nativescript-core/ui/frame/frame.android.ts b/nativescript-core/ui/frame/frame.android.ts index 778c40597..8bad9a26b 100644 --- a/nativescript-core/ui/frame/frame.android.ts +++ b/nativescript-core/ui/frame/frame.android.ts @@ -483,6 +483,13 @@ export class Frame extends FrameBase { } public createNativeView() { + // Create native view with available _currentEntry occur in Don't Keep Activities + // scenario when Activity is recreated on app suspend/resume. Push frame back in frame stack + // since it was removed in disposeNativeView() method. + if (this._currentEntry) { + this._pushInFrameStack(); + } + return new org.nativescript.widgets.ContentLayout(this._context); }