[android-developers] Service: both onStart() and onStartCommand() called

2010-09-22 Thread Christoffer Davidsson
Hello (World).

I'm trying to create a Service which is backwards compatible, working
on both pre-2.0 and post-2.0 phones.
Therefore I implement both onStart() and onStartCommand() according
to: 
http://developer.android.com/reference/android/app/Service.html#onStartCommand(android.content.Intent,
int, int).
Where the comments on onStart() say:
// This is the old onStart method that will be called on the pre-2.0
// platform.  On 2.0 or later we override onStartCommand() so this
// method will not be called.

However, running 2.1 in the Emulator, both methods are called when I
start my Service. Is this a bug? Did anyone else have this problem?

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


Re: [android-developers] Service: both onStart() and onStartCommand() called

2010-09-22 Thread TreKing
On Wed, Sep 22, 2010 at 4:16 AM, Christoffer Davidsson 
christof...@chlirre.com wrote:

 However, running 2.1 in the Emulator, both methods are called when I start
 my Service.


I don't suppose you're calling super.onStartCommand, are you?

-
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en