24.06.2010 10:49, appsgrrl пишет:
Hi -- Okay, I got further!  Yay!  It turns out that I also had to call
super.onCreate()  to avoid the null pointer exception.
So, if I call super.onCreate() and super.onStartCommand(),  my
onHandleIntent() does get excecuted.

Great. Both superclass methods need to get called - onCreate() set up a worker thread, and onStartCommand() queues the intent to this thread, which ultimately calls your onHandleIntent()
Now, my new mystery is why my service gets an onDestroy() call right
after it is started.
I return START_STICKY from onStartCommand, but that does not seem to
have an effect.
I guess I need to understand the life cycle stuff a little more.

This is intended behaviour. The service is stopped when the last queued intent has been processed by your subclass's onHandleIntent().

--

Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to