0

My issue is when an Android Application goes in the background. When I click the Home button and launch my app again from the home screen by clicking the Application icon, it should display the the same screen from which I went to the Home screen. But it calls the onDestory() method then comes out of my application. I thought the application is killed by the system because of memory requirement etc., but I need tokeep the activity and it should again show the same screen where I left instead of starting all over again.

This may be achieved like maintaining sessions.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Srinivasan
  • 4,481
  • 3
  • 28
  • 36

2 Answers2

1

try putting

android:alwaysRetainTaskState="true"

in the androidmanifest.xml for those activities, i think ICS does that by default now.

Prakash Nadar
  • 2,694
  • 1
  • 19
  • 20
0

The Application will show you the same screen when return after "home" button if your app with different screens is made of different activities to show the interface parts... But if you just make some objects

visible=true or false

so, after resume you'll see the first view... Try to use Intents between different activities... And show a piece of code to help you... Maybe the problem is in overriding of onDestroy, onPause, onResume methods

timonvlad
  • 1,046
  • 3
  • 13
  • 31