On Tue, Jul 20, 2010 at 6:25 AM, goosedroid <[email protected]> wrote:

> I spent some time looking with Google Code Search, but I have not been able
> to find instances where this was done.
>

Probably because calling startService within the Service itself to start
itself doesn't really make sense. If you're already in the Service, why do
you need to start it?


> Would there be any differences between these two attempts:
>
> Intent intent = new Intent(getApplicationContext(), MyService.class);
> startService(intent)
>
> or
>
> Intent intent = new Intent(this, MyService.class);
> startService(intent)
>

Don't use getApplicationContext(). There's absolutely no reason to do so.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
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