Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
- builder.setTitle("Digite a senha:");
- // Configurar o campo de entrada de texto
- final EditText input = new EditText(MainActivity.this);
- input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
- builder.setView(input);
- // Configurar o botão "OK"
- builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- String senha = input.getText().toString();
- if (senha.equals("oab123")) {
- anoi.setClass(getApplicationContext(), AnoTodoActivity.class);
- startActivity(anoi);
- } else {
- SketchwareUtil.showMessage(getApplicationContext(), "SENHA INCORRETA, DIGITE NOVAMENTE!🙄");
- }
- }
- });
- // Configurar o botão "Cancelar"
- builder.setNegativeButton("Cancelar", new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- dialog.cancel();
- }
- });
- // Exibir o diálogo
- builder.show();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement