java - Will my singleton be killed? -


i have application create foreground service make sure user initiated upload continues if user quits app or app killed memory pressure.

both service , app use singleton pass data around. know not best solution, kindly ask refrain comments bad-bad singletons question not in in following:

when close app, foreground service continues running , can access singleton. there risk of singleton being garbage collected due memory pressure or there other memory related risks of using singleton in case?

static variables destroyed when application killed. won't randomly disappear while service running. if entire service restarts have account possibility of not having singleton when restarts.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -