fix(frame): push recreated frame back in frameStack when Don't Keep Activities enabled (#8096)

This commit is contained in:
Alexander Djenkov
2019-11-22 11:18:37 +02:00
committed by GitHub
parent 786aca3039
commit 47f4c25a69
2 changed files with 15 additions and 8 deletions

View File

@@ -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,

View File

@@ -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);
}