Get Context in a Service
Service
extends ContextWrapper
which extends Context
. Hence the Service
is a Context
.Use 'this'
keyword in the service.
Service
extendsContextWrapper
ContextWrapper
extendsContext
So....
Context context = this;
(in Service or Activity Class)