tags:

views:

55

answers:

1

I am writing an app where I get all the data from the rest call and display all the data in a custom component list(based on Linear Layout) which is added to a LinearLayout. I write this code in onCreate of the activity.

The problem is when I switch activity using startActivity, and come back to the calling activity (using startActivity) then onCreate is called again. I see onPause, onStop called when I call other activity.

Is there any way that I can save the application's state?

+3  A: 

Check this question: "How do I save an android application state".

Edit: You can also avoid some calls to onCreate() by adding a

android:launchMode="singleTask"

to your Activity in the AndroidManifest.

Macarse
Thanx it worked :) I used singleInstance. But wondering if there could be any memory issues.
Kunal P.Bharati