Custom dialog


I have a question, as I do when I enter a text in an EditText of a main activity, then I appear in a dialog as a title?

asked by andres otalvaro 16.11.2018 в 22:41

1 answer


You can use an AlertDialog to show the dialogue with the title you want in the following way:

//this es el contexto de tu Activity
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
alertDialogBuilder.setTitle("AQUI EL TÍTULO QUE QUIERAS");
alertDialogBuilder.setMessage("AQUÍ EL MENSAJE");
alertDialogBuilder.setPositiveButton("Aceptar", null);;

You can get more information in the Android documentation about the Dialogs in this link: Dialog boxes | Android Developers

answered by 16.11.2018 / 22:47