Issue
So, the question is pretty self-explanatory. Can custom Application
object (the one I declare in AndroidManifest.xml
) be destroyed earlier than the launched Service
, provided that Service
is not launched in another process?
My intuition says it's not possible, since we can access Application
object in Service
by calling getApplication()
, plus I've not seen anything like this in documentation, but Android
is full of unexpected funny behaviors.
Solution
Can custom Application object (the one I declare in AndroidManifest.xml) be destroyed earlier than the launched Service, provided that Service is not launched in another process?
Each process gets its own Application
object, and that object lives as long as the process does. Hence, any component (e.g., a Service
) cannot outlive the Application
from its own process.
Answered By - CommonsWare
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.