Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. AlertDialog.Builder builder = new AlertDialog.Builder(Config.this);
  2.  
  3. builder.setMessage("Hola");
  4. builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
  5. @Override
  6. public void onClick(DialogInterface dialog, int which) {
  7. Toast toast = Toast.makeText(Config.this,"hola",Toast.LENGTH_SHORT);
  8. toast.show();
  9. }
  10. });
  11. builder.setNegativeButton("cancela", new DialogInterface.OnClickListener() {
  12. @Override
  13. public void onClick(DialogInterface dialog, int which) {
  14. Toast toast = Toast.makeText(Config.this,"adios",Toast.LENGTH_SHORT);
  15. toast.show();
  16. }
  17. });
  18. AlertDialog dialog = builder.create();
  19. dialog.show();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement