android


Converting singleton to service


I have a singleton set up to hold global variables throughout the lifespan of my app. It works, but I notice when I close my app, I lose these variables which means started services can't access to them. I think the best fix is to convert this to a started service that runs in the background, but I'm not sure how to do it :/ Could anyone help out? This is the class right now:
import com.google.android.gms.maps.model.LatLng;
import java.util.ArrayList;
import java.util.HashMap;
public class UserValues {
private static UserValues mInstance= null;
protected UserValues(){}
ArrayList<FavRoute> favorites;
ArrayList<BusRoute> stops;
HashMap<Integer, LatLng> geo;
//CONSTANTS
final int ADD_RESULT_KEY = 2;
public static synchronized UserValues getInstance(){
if(null == mInstance){
mInstance = new UserValues();
}
return mInstance;
}
}
Thanks!

Related Links

how to get attribute value from SAX xml Parser in Android?
Geting json response from Google places API in android
Android NDK and ALSA
event to identify Call Answering In Android
NO CERTIFICATE problem for a specific user
Building Android Webkit Plugins?
Honeycomb gallery sample
Why broadcastreciver doesn't receive the broadcast?
SetTextColor of TextView programatically
Android - How to open google maps with Intent and KML?
inner shadow on Android TextView
List-view with fragments using tab host?
Android implementation for socialauth
How to load a pdf file from the assets folder in android
program for android market
User Interface Fuzzing - Android

Categories

HOME
localization
apache-flink
nvd3.js
github-for-windows
themes
rendering
replace
static-site
big-o
web-hosting
boto3
lanczos
character
openpyxl
pybossa
flatpak
capistrano3
scsi
null-pointer
dimensional-modeling
squashfs
zxing
highstock
dapper-extensions
corpus
angularjs-components
appirater
entity-relationship-model
handler
xbox
complex-numbers
apiary.io
lint
timing
bc
ods
apache-stanbol
placeholder
avcapturedevice
apache-spark-dataset
vaadin-charts
dtsearch
activeperl
convex-optimization
x-ray
magic-draw
bbpress
libjpeg
cpu-cache
cmp
donations
mapxtreme
flex4.6
macaulay2
nikeplus-api
respondcms
design-principles
directdraw
rate-limiting
include-guards
rubaxa-sortable
page.js
sony-lifelog-api
iced-coffeescript
fail2ban
user-permissions
uncaught-typeerror
grails-plugin-rabbitmq
alternate
jquery-slider
memset
vsx
vbe
square-bracket
ora-06550
gd-graph
observium
mvc-editor-templates
nokia-s40
boost-signals
httponly
infobright
landscape-portrait
xui
dataform
qglwidget
commerceserver2007
ruby-1.8
timertask
duplex
tui
application-planning
wcf-proxy

Resources

Encrypt Message