Reputation: 14454
As title says, what is the difference (if any)? I was able to find only difference between Activity X Application contexts, but not Service X Application ones.
Thanks
Upvotes: 4
Views: 3281
Reputation: 1984
The Application is the base class for maintaining a global application state. its context is tied to the Application lifecycle.
The Service (I hope you already know what it is and what it does) has its own context tied to its lifecycle and which contains some information about itself.
Both Application and Service extend (indirectly) the Context class. Thus, each have its own context. The difference is - I hope you already got it - the Application Context is the context of the entire application, it lives from the start to the end of your app, while the Service Context only contains information about the Service object and lives as long as the Service lives.
It's pretty much the same thing like the difference between the Activity Context and the Application Context.
Also, I suggest you read the official documentation before posting questions. You might just find the answers there.
Upvotes: 1