I tried the answers from here, but I cannot get an activity to finish.
Here is the code:
private void myMethod() {
startActivity(startNewActivityOpen2);
GlobalVars.questionHolders = null; //is being called.
finish();
amTransitioning = true;
}
Calling Activity was started with these flags:
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
I tried
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK);
but this didn't work.
I can see that finish is getting called. My logcat is saying:
Duplicate finish request for ActivityRecord{426f37f8 u0 com.assistek.ediary/.PRO_GridOther t5569 f}
The activity continues along its merry way without finishing and I am getting a null pointer error because a singleton's value is getting cleared.