Advertisement
Guest User

Untitled

a guest
Nov 27th, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. private String horario = "";
  2. private void definirHorario(){
  3.  
  4. //abrir janela de informação do horário
  5. AlertDialog.Builder builder = new AlertDialog.Builder(this);
  6. builder.setTitle("Definir Horario");
  7.  
  8. // Set up the input
  9. final EditText input = new EditText(this);
  10. // Specify the type of input expected; this, for example, sets the input as a password, and will mask the text
  11. input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
  12. builder.setView(input);
  13.  
  14. // Set up the buttons
  15. builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
  16. @Override
  17. public void onClick(DialogInterface dialog, int which) {
  18. horario = input.getText().toString();
  19. }
  20. });
  21. builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
  22. @Override
  23. public void onClick(DialogInterface dialog, int which) {
  24. dialog.cancel();
  25. }
  26. });
  27.  
  28. builder.show();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement