I have this block of code where my app, supposedly, when the user inserts a right password and a right email, goes to the main activity, although when I used the run method, it says that the variable is never used.
@Override
protected void onPostExecute(final Boolean success) {
mAuthTask = null;
showProgress(false);
if (success) {
public void run() {
startActivity(new Intent(getBaseContext(), Second.class));
finish();
}
finish();
} else {
mPasswordView.setError(getString(R.string.error_incorrect_password));
mPasswordView.requestFocus();
}
}
It is because you have incorrect code in your method. Take a look at the following code:
@Override
protected void onPostExecute(final Boolean success) {
...
if (success) {
public void run() {
...
}
finish();
} else {
...
}
}
You have a block of method named run() which is incorrect. So, you need to remove it. Your code should be something like this then:
@Override
protected void onPostExecute(final Boolean success) {
mAuthTask = null;
showProgress(false);
if (success) {
startActivity(new Intent(getBaseContext(), Second.class));
finish();
} else {
mPasswordView.setError(getString(R.string.error_incorrect_password));
mPasswordView.requestFocus();
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With