Skip to content
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: 10 additions & 1 deletion packages/core/ui/core/view/index.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,16 @@ function initializeDialogFragment() {

return global.__native(this);
}

public onCreate(savedInstanceState: android.os.Bundle) {
super.onCreate(savedInstanceState);
var ownerId = this.getArguments()?.getInt(DOMID);
var options = getModalOptions(ownerId);
// The teardown when the activity is destroyed happens after the state is saved, but is not recoverable,
// Cancel the native dialog in this case or the app will crash with subsequent errors.
if (savedInstanceState != null && options === undefined) {
this.dismissAllowingStateLoss();
}
}
public onCreateDialog(savedInstanceState: android.os.Bundle): android.app.Dialog {
const ownerId = this.getArguments().getInt(DOMID);
const options = getModalOptions(ownerId);
Expand Down