I have written a service and get xml from web server and after that i put it in my ArrayList. The problem i am facing is that i have bind my service to AlarmManager and it executes it after every one minute, and the arraylist gets null every time the service is called. I want to retain is previous values but unable to find any solution.
Share
The somewhat evil way is create your
ArrayListas a class variable on your service:This should allow the value of
myListto stick around across instantiations of your service.Depending on what your code is doing it will be better to read data from the calling
Intentor to persist intermediate data in the service lifecycle methods.