diff --git a/packages/core/ui/core/view/index.android.ts b/packages/core/ui/core/view/index.android.ts index 5101f8a4cb..e6d1e2fd0b 100644 --- a/packages/core/ui/core/view/index.android.ts +++ b/packages/core/ui/core/view/index.android.ts @@ -684,6 +684,17 @@ export class View extends ViewCommon { return result | (childMeasuredState & layout.MEASURED_STATE_MASK); } protected _showNativeModalView(parent: View, options: ShowModalOptions) { + // if the app is in background while triggering _showNativeModalView + // then DialogFragment.show will trigger IllegalStateException: Can not perform this action after onSaveInstanceState + // so if in background we create an event to call _showNativeModalView when loaded (going back in foreground) + if (Application.inBackground && !parent.isLoaded) { + const onLoaded = ()=> { + parent.off('loaded', onLoaded) + this._showNativeModalView(parent, options); + }; + parent.on('loaded', onLoaded); + return; + } super._showNativeModalView(parent, options); initializeDialogFragment();
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: