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?

ludo
  • 1,456
  • 2
  • 14
  • 26
  • 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. – ludo 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
  • 53,220
  • 42
  • 124
  • 197