No, it's not either one, it's Application context.

But you want the service context, which is just 'this' (i.e. the
service itself). The application context would work too, but generally
you should go with the most specific context available unless you have
a reason otherwise. Using some context (in this case, some activity's
context) that you're not running in doesn't really make any sense.

That's all kind of implied by the word 'context'. Generally, it means
"what surrounds or is going on around something". In Android, and most
programming, it means "an object that represents what I'm doing right
now". So you're running a Service, in an Application. You are not
running an Activity in this code, so this code should not be dealing
with activity contexts at all.

A service context is just the service. An activity context is just the
Activity. The Application context is just the Application. (It
wouldn't have to be that way, but it is). Context is just an interface
common to all three.

On Aug 11, 2:57 am, CaryWang <[email protected]> wrote:
> NO,getApplicationContext() is Service Context don't Activity Context.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to