Guard double-showing of user credentials dialog

Only create & show the dialogfragment if it does not already exist.

Bug: 28058930
Change-Id: Ia48cc8a5fd60a12c3beb6c9263036a449cf8d67c
This commit is contained in:
Robin Lee
2016-04-07 13:17:24 +01:00
parent 2de9313d2c
commit f8e2dbf2d2

View File

@@ -104,11 +104,13 @@ public class UserCredentialsSettings extends OptionsMenuFragment implements OnIt
final Bundle args = new Bundle();
args.putParcelable(ARG_CREDENTIAL, item);
final CredentialDialogFragment frag = new CredentialDialogFragment();
if (target.getFragmentManager().findFragmentByTag(TAG) == null) {
final DialogFragment frag = new CredentialDialogFragment();
frag.setTargetFragment(target, /* requestCode */ -1);
frag.setArguments(args);
frag.show(target.getFragmentManager(), TAG);
}
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {