4
Hello I’m doing a project for college and I’m new on Android,I’m making an application that the purpose of it is to check if the password is correct to be able to finalize the application, but I’m not able to validate the password, I do not need to validate anything else, just the password.
I created 3 screens one for user registration, where is registered his email and password, when he registers he goes to another screen.
The second screen where the password is asked to finalize the app, and it is on this screen that I need the password to be validated, so that the password he registered is the only one that can finalize the app.
And the last screen is one for password recovery through email.
I am using this code for registration 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.
Show what you have on the second screen.
– Pablo Almeida