Created
February 17, 2013 16:44
-
-
Save antew/4972181 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* We have to override setOnShowListener here (min API level 8) in | |
* order to validate the inputs before closing the dialog. Just | |
* overriding setPositiveButton closes the automatically when the | |
* button is pressed | |
* | |
* @return The onShowListener for the AlertDialog | |
*/ | |
@Override | |
public void onShow(DialogInterface dialog) { | |
Button login = ((AlertDialog) dialog) | |
.getButton(AlertDialog.BUTTON_POSITIVE); | |
login.setOnClickListener(new OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
doLogin(); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment