Last active
April 10, 2017 03:11
-
-
Save fnovoac/007cbb53c86a5d9bf08a77856f0809ee 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
//Es es solo un Popup para mostrar información, no esperamos hacer algo con la respuesta | |
//de requerir recibir un input del usuario, debemos cambiar el "null" de la línea 11 por "this" | |
//y el activity debe implementar DialogInterface.OnClickListener | |
AlertDialog.Builder dialogInputUserBuilder = new AlertDialog.Builder(this); | |
dialogInputUserBuilder.setCancelable(false); | |
// fijamos el titulo del díalogo | |
dialogInputUserBuilder.setTitle("Ingrese un usuario"); | |
//asignamos una imagen de Android (de preferencia reemplazarla por de nuestro proyecyo) | |
dialogInputUserBuilder.setIcon(android.R.drawable.ic_input_add); | |
// fijamos el mensaje | |
dialogInputUserBuilder.setMessage("Nombre del usuario"); | |
// ver comentario al inicio | |
dialogInputUserBuilder.setPositiveButton("Grabar",null); | |
// creamos el díalogo | |
AlertDialog dialogInputUser = dialogInputUserBuilder.create(); | |
// lo mostramos | |
dialogInputUser.create().show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment