tags:

views:

268

answers:

3

Hi, There is a stack of activity i want to call the activity from that stack , My question is that is it possible to check from that stack and call that intent . When i press home button and again when i press the executable it should start the activity where i have left . Is it possible ? Any example related to the same would be great help

Thnx in advance .

+2  A: 

Could you please be a little more clear?

Do you want to persist your app's state?

Maybe like the built-in Browser application - when you go to stackoverflow.com, then press Home, then again start the browser, you'll find yourself on stackoverflow.com, like you've never exited the Browser.

If you want to do that, then Android will give you very convenient methods in your Activity that will be called just after your app is started and just before your app is closed (technically, that's not exactly true, but still). In that case, take a look here.

Dimitar Dimitrov
A: 

What you want is persistent state beyond just the onSaveInstanceState function, which only handles state for actions like phone rotations, but nothing long term like phone reboots or full application shutdown and restart.

You will need to roll your own state file and presumably your own stack of intents. This is what I had to do for a tabbed application that required long-term state. I kept a Stack of Intent objects in memory and then persisted them to an object file using normal Java serialization techniques. Then I read the file in and reconstructed the stack of activities, starting each one as required. Every app is different so there's no one correct way to do this.

The bottom line: You're going to have to do this yourself.

MattC
A: 

As I have understood, your problem is similar to this one.

http://stackoverflow.com/questions/2061143/android-keep-tasks-activity-stack-after-restart-from-home/2061447

Check the solution, may be this is your case as well.

alex2k8