Content-Length: 256161 | pFad | http://github.com/NativeScript/NativeScript/pull/10570/files

80 fix(android): prevent error while opening modal from background by farfromrefug · Pull Request #10570 · NativeScript/NativeScript · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): prevent error while opening modal from background #10570

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/core/ui/core/view/index.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/NativeScript/NativeScript/pull/10570/files

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy