I have two activities: ActivityA
and ActivityB
. In each activity, I have create a button with onClick method to startActivity
to another activity.
ActivityA.java
public void doNext(View view) {
startActivity(new Intent(ActivityA.this, ActivityB.class));
}
ActivityB.java
public void doBack(View view) {
finish();
}
When I press doNext
it navigated me to the ActivityB, I kill the app on the ActivityB, but the onDestroy
on ActivityA got called (it must be the onDestroy
on the ActivityB). Can somebody explain me what happened?
This is the flow of my program: onCreate (A) -> onStart (A) -> onResume (A) -> onPause (A) -> onCreate (B) -> onStart (B) -> onResume (B) -> onStop (A) -> Kill the app (swipe to dismiss) on ActivityB -> onPause (B) -> onStop (B) -> onDestroy (A) .