Closed 1derwood closed 11 years ago
In your Java code, make use of SharedPreferences. In SetConfig you will write the value to your SharedPref. In doWork you will read it.
Works for me.
See my blog for some code examples for SharedPreferences: http://teusink.blogspot.nl/2013/09/phonegap-android-androidpreferences.html?m=1
Works great, thanks!
I'm passing a value to the background service from JS via setConfiguration and storing that value in a member variable for use in each call to doWork. This all works swimmingly as long as my app is alive. However, if I suspend the app and open a couple of other apps, I notice that initialiseLatestResult is called and my member variable has lost its value. The service continues to run at the requested interval but it seems to have been reset. Any way around this?