Question: I have 3 activities in my app.

> 
> Home -> List -> Detail
> 
> 
> 

When I am in Detail activity, I want to have a home button that will redirect me to Home activity and close the other activities. Then, I tried this code:

```
Intent intent = new Intent(this, HomeActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);

```

since the `FLAG_ACTIVITY_CLEAR_TOP` is:

> 
> If set, and the activity being launched is already running in the
>  current task, then instead of launching a new instance of that
>  activity, all of the other activities on top of it will be closed and
>  this Intent will be delivered to the (now on top) old activity as a
>  new Intent.
> 
> 
> 

I got what I want, but then it still goes to onCreate. Is there any way to launch the home and not going to its onCreate?

Answer: 
Your thinking and Android's are not yet fully compatible. ;)

When you "launch the home", that means it's going to be *launched*, and that means it's going to be created.

You can, however, use [`Activity.startActivityForResult()`](http://developer.android.com/reference/android/app/Activity.html#startActivityForResult%28android.content.Intent,%20int%29) to start `List` and `Detail`. Your "home" button then will [`finish`](http://developer.android.com/reference/android/app/Activity.html#finish%28%29) your `Detail` Activity. In the [`onActivityResult`](http://developer.android.com/reference/android/app/Activity.html#onActivityResult%28int,%20int,%20android.content.Intent%29) callback of `List`, you'll just pass through using `Activity.finish()`, and in `onActivityResult` of `Home` you'll just catch the event and know that you're now back.
You cannot control the `Activity` life cycle. It's up to Android to decide which activities to keep running and which to close. This means that when an Activity loses focus, it is not necessarily destroyed or closed, but might simply lost focus and keep running, but might also not. This is up to Android; you cannot control this behavior.

If you want to recover an `Activity` in a given state, you have to save all needed data and restore it in `onCreate()`.