mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-03 13:44:40 +00:00
Prevent crash
This commit is contained in:
parent
eeda538546
commit
73e4f2c4f9
1 changed files with 13 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue