I'm working on an app, which is using a homescreen widget to play a sound from a source, that the user chose in the app's main activity. After some time my app looses the information about the assigned sourcefile and I have to re-enter the main activity to pick a sound again. I guess this happens because my app is killed or put asleep by the OS.
So my question is how to make those settings I've made in the main activity persistent, so that my homescreen widget doesn't stop to work after a certain amount of time.
Also I'd like to know if there is a need, to keep this main activity alive somehow, since the homescreen widget is sending broadcasts to it when the button is pressed in order make it send a message to my mediaplayer service, which would play the sound.