In this activity when both password and username are correct then I have shown a toast and an intent to move to next screen after login, but only toast works, intent is not working?
btnSignIn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// get The User name and Password
String userName = editTextUserName.getText().toString();
String password = editTextPassword.getText().toString();
// fetch the Password form database for respective user name
String storedPassword = loginDataBaseAdapter.getSinlgeEntry(userName);
// check if the Stored password matches with Password entered by
// user
if (password.equals(storedPassword)) {
Toast.makeText(HomeActivity.this, "Congrats: Login Successfull",
Toast.LENGTH_LONG).show();
dialog.dismiss();
Intent intent = new Intent(getApplicationContext(), ViewFolders.class);
startActivity(intent);
} else {
Toast.makeText(HomeActivity.this, "User Name or Password does not match",
Toast.LENGTH_LONG).show();
}
}
});
After login it is not moving to ViewFolders.class
Use:
Intent intent=new Intent(HomeActivity.this,ViewFolders.class);
startActivity(intent);
Instead of:
Intent intent=new Intent(getApplicationContext(),ViewFolders.class);
startActivity(intent);
Beside this hope ViewFolders
activity is added to manifest already
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments