From LoginActivity after successful login app goes to the MainActivity. When I click the back button i get this warning.
W/ActivityManager: Duplicate finish request for ActivityRecord
And when I start the app again LoginActivity is called again.
After successful login I call
Intent intent = new Intent(this, HomeActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
finish();
The problem is only in the release build.
If this is not related to back press, maybe you have more than one finish() call from different places. Just check if activity is finishing or not, if yes then skip the 2nd call.
if (!YourActivity.this.isFinishing()) {
finish();
}
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