@@ -859,13 +859,13 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
859859 // lose its parent we temporarily add it to the parent, and then remove it (addViewInLayout doesn't trigger layout pass)
860860 const nativeView = page . nativeViewProtected ;
861861 if ( nativeView != null ) {
862- const parentView = nativeView . getParent ( ) ;
862+ const parentView = nativeView . getParent ( ) ;
863863 if ( parentView instanceof android . view . ViewGroup ) {
864864 if ( parentView . getChildCount ( ) === 0 ) {
865865 parentView . addViewInLayout ( nativeView , - 1 , new org . nativescript . widgets . CommonLayoutParams ( ) ) ;
866866 }
867867
868- parentView . removeView ( nativeView ) ;
868+ parentView . removeView ( nativeView ) ;
869869 }
870870 }
871871
@@ -1006,6 +1006,30 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
10061006 }
10071007 }
10081008
1009+ @profile
1010+ public onPostResume ( activity : any , superFunc : Function ) : void {
1011+ superFunc . call ( activity ) ;
1012+
1013+ if ( traceEnabled ( ) ) {
1014+ traceWrite ( "NativeScriptActivity.onPostResume();" , traceCategories . NativeLifecycle ) ;
1015+ }
1016+
1017+ // NOTE: activity.onPostResume() is called when activity resume is complete and we can
1018+ // safely raise the application resume event;
1019+ // onActivityResumed(...) lifecycle callback registered in application is called too early
1020+ // and raising the application resume event there causes issues like
1021+ // https://github.com/NativeScript/NativeScript/issues/6708
1022+ if ( ( < any > activity ) . isNativeScriptActivity ) {
1023+ const args = < application . ApplicationEventData > {
1024+ eventName : application . resumeEvent ,
1025+ object : application . android ,
1026+ android : activity
1027+ } ;
1028+ application . notify ( args ) ;
1029+ application . android . paused = false ;
1030+ }
1031+ }
1032+
10091033 @profile
10101034 public onDestroy ( activity : any , superFunc : Function ) : void {
10111035 if ( traceEnabled ( ) ) {
0 commit comments