Android activity lifecycle - activity restarts when coming from history?

Make sure you are calling finish() on A when you load B.

Up vote 0 down vote favorite share g+ share fb share tw.

I have a splash activity (A) that calls a listview activity (B) which calls another activity (C). When I'm on activity C and I press Home, than kill the app (or wait of Android to do it), than longpress Home and come back to activity C there's a strange problem: When I click back I go back to B. Than I have a backbutton handler that asks the user if they want to exit and calls finish() on the activity.

When I try to exit in this scenario, activity A starts again. On regular operation it finishes B and doesn't go back to A. Why is that?

Thanks android android-intent android-activity link|improve this question asked Mar 20 at 19:47Ronen Yacobi31.

Thanks! That seems to solve to solve the problem. BTW - on ICS it happened even without killing the app - on finish() of activity B it restarted A.

Very strange. – Ronen Yacobi Mar 21 at 10:55 Activity Stacks can be complex at first, takes some time to understand their power :) If you could please accept an answer that would be great – Mimminito Mar 21 at 12:55.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions