File tree Expand file tree Collapse file tree
nativescript-core/ui/frame Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,31 +70,31 @@ export class FrameBase extends CustomLayoutView implements FrameDefinition {
7070 const top = FrameBase . topmost ( ) ;
7171 if ( top && top . canGoBack ( ) ) {
7272 top . goBack ( ) ;
73-
73+
7474 return true ;
7575 } else if ( top ) {
7676 let parentFrameCanGoBack = false ;
7777 let parentFrame = < FrameBase > getAncestor ( top , "Frame" ) ;
78-
78+
7979 while ( parentFrame && ! parentFrameCanGoBack ) {
8080 if ( parentFrame && parentFrame . canGoBack ( ) ) {
8181 parentFrameCanGoBack = true ;
8282 } else {
8383 parentFrame = < FrameBase > getAncestor ( parentFrame , "Frame" ) ;
8484 }
8585 }
86-
86+
8787 if ( parentFrame && parentFrameCanGoBack ) {
8888 parentFrame . goBack ( ) ;
89-
89+
9090 return true ;
9191 }
9292 }
93-
93+
9494 if ( frameStack . length > 1 ) {
9595 top . _popFromFrameStack ( ) ;
9696 }
97-
97+
9898 return false ;
9999 }
100100
@@ -216,11 +216,11 @@ export class FrameBase extends CustomLayoutView implements FrameDefinition {
216216 traceWrite ( `NAVIGATE` , traceCategories . Navigation ) ;
217217 }
218218
219+ this . _pushInFrameStack ( ) ;
220+
219221 const entry = buildEntryFromArgs ( param ) ;
220222 const page = Builder . createViewFromEntry ( entry ) as Page ;
221223
222- this . _pushInFrameStack ( ) ;
223-
224224 const backstackEntry : BackstackEntry = {
225225 entry : entry ,
226226 resolvedPage : page ,
Original file line number Diff line number Diff line change @@ -483,6 +483,13 @@ export class Frame extends FrameBase {
483483 }
484484
485485 public createNativeView ( ) {
486+ // Create native view with available _currentEntry occur in Don't Keep Activities
487+ // scenario when Activity is recreated on app suspend/resume. Push frame back in frame stack
488+ // since it was removed in disposeNativeView() method.
489+ if ( this . _currentEntry ) {
490+ this . _pushInFrameStack ( ) ;
491+ }
492+
486493 return new org . nativescript . widgets . ContentLayout ( this . _context ) ;
487494 }
488495
You can’t perform that action at this time.
0 commit comments