0

I am creating app that download 4-5 images from server and display as gallery. It working fine in normal condition. but when there is incoming call or device is in sleep mode my activity load data from starting after onResume, i am not able to load data(Resume activity) from previous state of activity.

Is there any soulution?

Thanks

Piyush
  • 2,589
  • 6
  • 38
  • 77

3 Answers3

0

Check out Saving Cache Files. Save your images on pause and restore them on resume.

Ash
  • 1,701
  • 13
  • 18
0

You should probably cache the files, so it works like this, check if files already exist, if not download, when files exist load pictures,

http://developer.android.com/guide/topics/data/data-storage.html#ExternalCache

dten
  • 2,364
  • 21
  • 28
0

You should read how to handle runtime changes.

Basically, under some situations your Activity will be recreated. To preserve state you can pass objects between old and new Activity, using onSaveInstanceState() in old activity and onRestoreInstanceState() in new activity.

Peter Knego
  • 79,991
  • 11
  • 123
  • 154