Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private String horario = "";
- private void definirHorario(){
- //abrir janela de informação do horário
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setTitle("Definir Horario");
- // Set up the input
- final EditText input = new EditText(this);
- // Specify the type of input expected; this, for example, sets the input as a password, and will mask the text
- input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
- builder.setView(input);
- // Set up the buttons
- builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- horario = input.getText().toString();
- }
- });
- builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- dialog.cancel();
- }
- });
- builder.show();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement