2

I am developing an app that is having function to upload images to instagram. So when i upload the image to instagram and press the home button,the app is closed and when i ma relaunching the app it is starting from the main[ splash screen] activity.

In that application i am having option to take images from gallery and the camera. So when i press the home button and relaunch the app it should start the activity where i can chose the images.

I have tried a lot. If anyone have the solution please help me out.

Biplab
  • 91
  • 1
  • 11
  • 1
    you can use shared Preference to save your position in app and in first activity check that – Shayan Pourvatan Dec 16 '13 at 05:21
  • Post your code of activity, Normally it wont close, May be you are calling finish somewhere – Viswanath Lekshmanan Dec 16 '13 at 05:33
  • see it may help you http://stackoverflow.com/questions/15353900/shared-preferences-reset-data-when-app-is-force-closed-or-device-is-restarted – Shailendra Madda Dec 16 '13 at 05:36
  • may be comment by Arju 34 is possible or your app is consuming more memory so OS is destroying the activity stack, try android:largeHeap=true in the manifest's application tag – Rajesh Batth Dec 16 '13 at 06:09
  • This answer may help you. This is not my post. http://stackoverflow.com/questions/19860321/open-last-activity-when-the-app-is-killed – Sam Mar 02 '15 at 13:17
  • This answer may help you. This is not my post. http://stackoverflow.com/questions/19860321/open-last-activity-when-the-app-is-killed – Sam Mar 02 '15 at 13:18

2 Answers2

0

By default the last activity will be shown when the app is restarted. Unless you have added any 'no history flag' or:

 android:noHistory="true"

Set noHistory to false. ..

amalBit
  • 12,041
  • 6
  • 77
  • 94
0

By default last activity will open when relaunch the app.But some device it will not happen. I don't know the proper reason but may there is settings problem in that device.

DEV
  • 16