Hello, I'm doing a project for college and I'm new to Android, I'm making an application that it's intended to check if the password is correct to finish the application, but I'm not able to validate the password, I do not need validate something else, just the password.
I have created 3 screens one for the user's registration, where his email and password are registered, when he registers he goes to another screen.
The second screen where the password is requested to end the app, and it is on this screen that I need the password to be validated, so that the password that it has registered is the only one that can terminate the app.
And the last screen is one for password recovery through email.
I'm using this code to register on the first screen:
editEmail = (EditText) findViewById(R.id.editEmail); //Determinando o ID das coisas
editSenha = (EditText) findViewById(R.id.editSenha);
db=openOrCreateDatabase("CadastroDB", Context.MODE_PRIVATE, null);
db.execSQL("CREATE TABLE IF NOT EXISTS cadastro (Email VARCHAR, Senha VARCHAR);");
}
//Botão Cadastrar
public void btnCadastro (View view) {
if(editEmail.getText().toString().trim().length()==0 || editSenha.getText().toString().trim().length()==0)
{
showMessage("Erro", "Preencha os Campos");
}
db.execSQL("INSERT INTO cadastro VALUES('"+editEmail.getText()+"','"+editSenha.getText()+"');");
showMessage("Ok", "Dados Gravados");
clearText();
Toast.makeText(getApplicationContext(), "Redirecionando...", Toast.LENGTH_SHORT).show();
setContentView(R.layout.activity_second);
}
Now I just need to validate on screen 2 this password for the project to end ... If anyone can help, I would appreciate it.