>>>>> "MM" == Mark Murphy <[email protected]> writes:

   MM> On Thu, Dec 27, 2012 at 12:22 PM, Jake Colman <[email protected]> wrote:

   >> Hmmmm.  The service's onHandleIntent is basically a set of
   >> 'if/else' clauses for the intents I am looking for with a final
   >> 'else' for any unrecognized intent.  After that final 'else' there
   >> is no other code.

   MM> Which means your service will be destroyed a handful of
   MM> microseconds after that final else. Using an IntentService for
   MM> location tracking is a no-no.

   >> In my logcat I see that the code for determining the location has
   >> been triggered (I have debug statements showing me the available
   >> and best providers) but then I immediately see the service's
   >> onDestroy method logging that it was called.

   MM> That is precisely what I am telling you is supposed to happen.

   >> Either way, how do I make sure I stay alive long enough for my
   >> Listener to get an update?

   MM> Stop using an IntentService. Use a regular Service, one for which
   MM> you control the lifecycle.


Sorry, I misunderstood.  Initially you said that the service should not
be destroyed so quickly. I didn't realize that you were distinguishing
between an Intent Service and a regular service.

Is it acceptable practice to have my AppWidgetProvider start a regular
service to handle this kind of work?  If that's the case there's not
much that would likely need to change in my overall code.

What about leaving everything as is but track location updates via an
Intent instead of a listener?  I imagine that would be abusive since an
AppWidgetProvider shouldn't be handling a potentially continuous stream
of intents such as could be fired from the location updates.


-- 
Jake Colman -- Android Tinkerer

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