mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-31 01:51:24 +01:00
Use dialog fragment to select account
This commit is contained in:
@@ -10,6 +10,8 @@ import androidx.fragment.app.Fragment;
|
||||
import static android.app.Activity.RESULT_CANCELED;
|
||||
|
||||
public class DialogFragmentEx extends DialogFragment {
|
||||
private boolean once = false;
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
super.onDismiss(dialog);
|
||||
@@ -17,11 +19,15 @@ public class DialogFragmentEx extends DialogFragment {
|
||||
}
|
||||
|
||||
protected void sendResult(int result) {
|
||||
Fragment target = getTargetFragment();
|
||||
if (target != null) {
|
||||
Intent data = new Intent();
|
||||
data.putExtra("args", getArguments());
|
||||
target.onActivityResult(getTargetRequestCode(), result, null);
|
||||
if (!once) {
|
||||
once = true;
|
||||
Fragment target = getTargetFragment();
|
||||
Log.i("Dialog target=" + target + " result=" + result);
|
||||
if (target != null) {
|
||||
Intent data = new Intent();
|
||||
data.putExtra("args", getArguments());
|
||||
target.onActivityResult(getTargetRequestCode(), result, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user