private static final String PROFILE_NAME = "org.strongswan.android.MainActivity.PROFILE_NAME";
private static final String PROFILE_REQUIRES_PASSWORD = "org.strongswan.android.MainActivity.REQUIRES_PASSWORD";
private static final String PROFILE_RECONNECT = "org.strongswan.android.MainActivity.RECONNECT";
+ private static final String DIALOG_TAG = "Dialog";
private Bundle mProfileInfo;
private VpnStateService mService;
profileInfo.putBoolean(PROFILE_REQUIRES_PASSWORD, profile.getVpnType().getRequiresUsernamePassword());
profileInfo.putString(PROFILE_NAME, profile.getName());
- removeFragmentByTag("ConfirmationDialog");
- removeFragmentByTag("LoginDialog");
- removeFragmentByTag("ErrorDialog");
+ removeFragmentByTag(DIALOG_TAG);
if (mService != null && mService.getState() == State.CONNECTED)
{
ConfirmationDialog dialog = new ConfirmationDialog();
dialog.setArguments(profileInfo);
- dialog.show(this.getFragmentManager(), "ConfirmationDialog");
+ dialog.show(this.getFragmentManager(), DIALOG_TAG);
return;
}
startVpnProfile(profileInfo);
{
LoginDialog login = new LoginDialog();
login.setArguments(profileInfo);
- login.show(getFragmentManager(), "LoginDialog");
+ login.show(getFragmentManager(), DIALOG_TAG);
return;
}
prepareVpnService(profileInfo);
bundle.putInt(ERROR_MESSAGE_ID, messageId);
VpnNotSupportedError dialog = new VpnNotSupportedError();
dialog.setArguments(bundle);
- dialog.show(activity.getFragmentManager(), "ErrorDialog");
+ dialog.show(activity.getFragmentManager(), DIALOG_TAG);
}
@Override