tags:

views:

116

answers:

2

While developing a sample android application i have constructed two activities 1)Activity 1 2)Activity 2

Now Activity 2 is the foreground activity whereas Activity 1 is the background one. Now user presses Home key. The application(i.e. both the activities) dissappear. Now is we relaunch the application we see Activity 1 as the foreground activity. My question is:

1)Does the platform maintain any history entry when pressed home key? 2)How do we take the user to the last launch activity on relaunching the application?

+1  A: 

Does the platform maintain any history entry when pressed home key?

Yes. Activities when launched/finished are pushed/pop'd onto/from a History Stack.

How do we take the user to the last launch activity on relaunching the application?

AFAICT, that should be the default behavior. When you relaunch your application you are taken to the last Activity on the stack unless you alter the stack.

Read this for details: Application Fundamentals - Activities and Tasks

Samuh
A: 

I can also recommend reading Activity and Task Design Guidelines. These are the user interface guidelines on how to behave when the Home button pressed, when the Back button is pressed, and so on.

It's not very technical, but it illustrates very well how your app should behave and what the OS expects.

pableu