0

I'm having some trouble and head-banging for a while now. The app I'm working on is GPS based together with Google Maps embedded. I can place a pin when tap on any place of the map and what I need is when I reopen the app to see all pins placed already.

I thought about using SharedPreferences (method for saving and method for loading back) but since the pins are saved in ArrayList<Overlay> I don't really know how to retrieve it (only long, int, string, float, boolean are available).

Is there some other option of doing of this?

Please help.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Pepys
  • 981
  • 7
  • 16
  • 34

1 Answers1

1

This is a really common problem. Its solved using Bundles these questions should provide you will everything you need. The first explains how to use the bundle to save and load state. The others explain how to save an ArrayList to the bundle.

Saving Android Activity state using Save Instance State

How to save ArrayList in an Bundle Object

Passing ArrayList Objects through Bundle?

Community
  • 1
  • 1
slayton
  • 20,123
  • 10
  • 60
  • 89