0

I have the following situation: I need to save data from an Intent's putExtra call into another Activity. I am able to display the putExtra data, however I cannot save it. I am using startActivity to start the activity that I need to save the data in. I am attempting to store it by adding the data to an ArrayList, however whenever I change Activities the data is lost. Also it only stores the last value. How can I store the sent data in the second Activity?

paulot
  • 1,368
  • 2
  • 12
  • 25
  • What do you mean by _"I cannot save it"_? Can you retrieve that data in your destination activity? – Chopin May 13 '12 at 01:47
  • @Chopin Yes I can retrieve the data in the destination activity. However, whenever I switch back to the activity that sent the data, I lose the data. Its as if the receiving application gets re-created every time I switch over to it. – paulot May 13 '12 at 01:53

1 Answers1

1

You can store it in the Application Context as described here:

Static way to get 'Context' on Android?

Community
  • 1
  • 1
Abdullah Jibaly
  • 50,216
  • 39
  • 119
  • 196