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.

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.



On Jun 23, 9:05 pm, appsgrrl <bettyoch...@gmail.com> wrote:
> Hi -- You know, that was one of the first things I had thought of, so
> I put a call to super.onHandleIntent() in my class code.
> However, I got a NullPointerException  from IntentService.onStart(),
> which is called from IntentService.onStartCommand(), which is from my
> class's onStartCommand()
>
> I tried it again, and played with the arguments to no avail.  I assume
> that I use my incoming arguments and pass them  to the
> super.onStartCommand(), correct?
>
> Thanks again for your help
>
> On Jun 23, 7:47 am, Mark Murphy <mmur...@commonsware.com> wrote:
>
> > On Wed, Jun 23, 2010 at 10:37 AM, appsgrrl <bettyoch...@gmail.com> wrote:
> > > Thanks for replying.   I also have a logging printout in the
> > > onStartCommand() method, and that does show as being called.
> > > If onStartCommand() is called, doesn't that mean my startService()
> > > from my Activity has indeed started my IntentService?
>
> > Yes. However, be sure you are chaining to the superclass in
> > onStartCommand() -- otherwise, you will block IntentService from
> > dispatching your Intent to onHandleIntent() via the background thread.
>
> > > Who ultimately calls onHandleIntent()?
>
> > IntentService does.
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> > _The Busy Coder's Guide to *Advanced* Android Development_
> > Version 1.6 Available!

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