Has result

This commit is contained in:
M66B 2021-12-27 08:40:22 +01:00
parent 00052d727d
commit af4afe82ab
1 changed files with 6 additions and 5 deletions

View File

@ -35,9 +35,10 @@ import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleRegistry;
import static android.app.Activity.RESULT_CANCELED;
import static android.app.Activity.RESULT_OK;
public class FragmentDialogBase extends DialogFragment {
private boolean once = false;
private boolean hasResult = false;
private LifecycleOwner owner;
private LifecycleRegistry registry;
private String targetRequestKey;
@ -179,7 +180,7 @@ public class FragmentDialogBase extends DialogFragment {
throw new IllegalArgumentException();
}
once = false;
hasResult = false;
targetRequestCode = requestCode;
}
@ -187,10 +188,10 @@ public class FragmentDialogBase extends DialogFragment {
EntityLog.log(getContext(), "Sending key=" + targetRequestKey +
" request=" + targetRequestCode +
" result=" + resultCode +
" once=" + once);
" has=" + hasResult);
if (!once) {
once = true;
if (!hasResult || resultCode == RESULT_OK) {
hasResult = true;
if (targetRequestKey != null) {
Bundle args = getArguments();