mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-01 02:21:37 +01:00
Prevent crash
This commit is contained in:
@@ -4,8 +4,10 @@ import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import static android.app.Activity.RESULT_CANCELED;
|
||||
|
||||
@@ -21,6 +23,17 @@ public class FragmentDialogEx extends DialogFragment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show(@NonNull FragmentManager manager, @Nullable String tag) {
|
||||
try {
|
||||
super.show(manager, tag);
|
||||
} catch (IllegalStateException ex) {
|
||||
// Can not perform this action after onSaveInstanceState
|
||||
// Should not happen, but still happened in AdapterMessage.onOpenLink
|
||||
Log.w(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
sendResult(RESULT_CANCELED);
|
||||
|
||||
Reference in New Issue
Block a user