Commit 3a84c9e4 authored by Nastuzzi Samy's avatar Nastuzzi Samy
Browse files

Bug fix

Reading input is not possible in a dismiss function
parent 81168dd9
......@@ -219,6 +219,9 @@ public class MainActivity extends NFCActivity {
.setPositiveButton(R.string.connexion, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
if (usernameInput.getText().toString().equals("") || passwordInput.getText().toString().equals("")) {
if (!usernameInput.getText().toString().equals(""))
casConnexion.setUsername(usernameInput.getText().toString());
Toast.makeText(MainActivity.this, R.string.username_and_password_required, Toast.LENGTH_SHORT).show();
dialog.cancel();
connectDialog();
......@@ -237,13 +240,6 @@ public class MainActivity extends NFCActivity {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
})
.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialogInterface) {
if (!usernameInput.getText().toString().equals(""))
casConnexion.setUsername(usernameInput.getText().toString());
}
});
dialog.createDialog(alertDialogBuilder, usernameInput.getText().toString().isEmpty() ? usernameInput : passwordInput);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment