AlertDialog Input Text
Posted
by soclose
on Stack Overflow
See other posts from Stack Overflow
or by soclose
Published on 2010-06-10T02:59:08Z
Indexed on
2010/06/10
3:02 UTC
Read the original article
Hit count: 399
android
|alertdialog
Hi,
I'd like to use AlertDialog as a pin code or password dialog. Here is my code -
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle("Login");
alert.setMessage("Enter Pin :");
// Set an EditText view to get user input
final EditText input = new EditText(this);
alert.setView(input);
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
String value = input.getText().toString();
Log.d( TAG, "Pin Value : " + value);
return;
}
});
alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
return;
}
});
alert.show();
How to code that all input text will appear like ' * '
© Stack Overflow or respective owner