views:

373

answers:

2

Hello,

I have an application with several Activities. My A Activity has the Manifest Intent filter parameters: action.MAIN and category.LAUNCHER. after its being loaded I call Activity B and finish() A since I don't use it anymore.

After I run my application, go from Activity A to B and press the Home button, when I relaunch it from the applications menu or from the Market app for ex.(not by a long press on the Home button), it starts from the A Activity and do not save its last Activity B.

I definitely know that this is possible to relaunch an application from its last Activity (some application from the Market do support it) and I think that this can be determined by the Manifest parameters but I don't know which one.

does anyone know how to implement it so my application can relaunch from its last Activity B?

Thanks ayanir

A: 

There have been a number of very similar questions lately. It's a good idea to search the site first to ensure that duplicate questions don't get asked.

For example, the question linked below says that this behaviour was happening because the developer was starting their application using the Eclipse debugger. Another person was having this problem because they were launching the application directly from Eclipse, rather than starting cleanly by manually pressing the launcher icon.

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

Christopher
Note that this behaviour has been fixed in the 0.9.6 release of the ADT plugin for Eclipse.
Christopher
A: 

Hi, so there are a few things to consider when developing Apps in Android. And one of the big things is the Application Lifecyle, if you haven't yet then I would suggest this video. What happens is that an application can be killed and reset at any point in time and you need to save the state of your application so that you can restore it at any time. If you open your App from the Launcher you will always go into the Activity that starts the app, if you want to skip to the next Activity you need to store that information and then jump to the Activity in your code.
Also have a look at this documentation about SavingPersistentState

AGrunewald