Last active
January 1, 2016 06:39
-
-
Save VAlux/8106276 to your computer and use it in GitHub Desktop.
Android prompt dialog using alert builder
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
final EditText txt = new EditText(this); | |
new AlertDialog.Builder(this) | |
.setTitle("Title") | |
.setView(txt) | |
.setPositiveButton("Ok", new DialogInterface.OnClickListener() { | |
public void onClick(DialogInterface dialog, int whichButton) { | |
String url = txtUrl.getText().toString(); | |
//do smth. with it. | |
} | |
}) | |
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { | |
public void onClick(DialogInterface dialog, int whichButton) { | |
dialog.cancel(); | |
} | |
}) | |
.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment