mirror of https://github.com/M66B/FairEmail.git
Has result
This commit is contained in:
parent
00052d727d
commit
af4afe82ab
|
@ -35,9 +35,10 @@ import androidx.lifecycle.LifecycleOwner;
|
||||||
import androidx.lifecycle.LifecycleRegistry;
|
import androidx.lifecycle.LifecycleRegistry;
|
||||||
|
|
||||||
import static android.app.Activity.RESULT_CANCELED;
|
import static android.app.Activity.RESULT_CANCELED;
|
||||||
|
import static android.app.Activity.RESULT_OK;
|
||||||
|
|
||||||
public class FragmentDialogBase extends DialogFragment {
|
public class FragmentDialogBase extends DialogFragment {
|
||||||
private boolean once = false;
|
private boolean hasResult = false;
|
||||||
private LifecycleOwner owner;
|
private LifecycleOwner owner;
|
||||||
private LifecycleRegistry registry;
|
private LifecycleRegistry registry;
|
||||||
private String targetRequestKey;
|
private String targetRequestKey;
|
||||||
|
@ -179,7 +180,7 @@ public class FragmentDialogBase extends DialogFragment {
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
}
|
}
|
||||||
|
|
||||||
once = false;
|
hasResult = false;
|
||||||
targetRequestCode = requestCode;
|
targetRequestCode = requestCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,10 +188,10 @@ public class FragmentDialogBase extends DialogFragment {
|
||||||
EntityLog.log(getContext(), "Sending key=" + targetRequestKey +
|
EntityLog.log(getContext(), "Sending key=" + targetRequestKey +
|
||||||
" request=" + targetRequestCode +
|
" request=" + targetRequestCode +
|
||||||
" result=" + resultCode +
|
" result=" + resultCode +
|
||||||
" once=" + once);
|
" has=" + hasResult);
|
||||||
|
|
||||||
if (!once) {
|
if (!hasResult || resultCode == RESULT_OK) {
|
||||||
once = true;
|
hasResult = true;
|
||||||
|
|
||||||
if (targetRequestKey != null) {
|
if (targetRequestKey != null) {
|
||||||
Bundle args = getArguments();
|
Bundle args = getArguments();
|
||||||
|
|
Loading…
Reference in New Issue