Seems I'm having trouble keeping my service running.
12-21 02:24:49.060: WARN/MessageQueue(267):
java.lang.RuntimeException: Handler{43782188} sending message to a
Handler on a dead thread
12-21 02:24:49.060: WARN/MessageQueue(267): at
android.os.MessageQueue.enqueueMessage(MessageQueue.java:181)
12-21 02:24:49.060: WARN/MessageQueue(267): at
android.os.Handler.sendMessageAtTime(Handler.java:457)
12-21 02:24:49.060: WARN/MessageQueue(267): at
android.os.Handler.sendMessageDelayed(Handler.java:430)
12-21 02:24:49.060: WARN/MessageQueue(267): at
android.os.Handler.sendMessage(Handler.java:367)
12-21 02:24:49.060: WARN/MessageQueue(267): at
android.location.LocationManager$ListenerTransport.onLocationChanged
(LocationManager.java:147)
12-21 02:24:49.060: WARN/MessageQueue(267): at
android.location.ILocationListener$Stub.onTransact
(ILocationListener.java:65)
12-21 02:24:49.060: WARN/MessageQueue(267): at
android.os.Binder.execTransact(Binder.java:287)
12-21 02:24:49.060: WARN/MessageQueue(267): at
dalvik.system.NativeStart.run(Native Method)
12-21 02:24:49.070: WARN/MessageQueue(267): Handler{437aca88} sending
message to a Handler on a dead thread
Using a service or wakefulintent service, I still get this. I had
aquireStaticWakeLock called before my WakefulIntentService was
started...
On Dec 20, 1:47 pm, dapaintballer331 <[email protected]>
wrote:
> I'll try the time zone problem.
>
> The reason I used your WakefulIntentService was just to make sure the
> application stays awake, I'm going to remove this now as it is working
> just as well as a regular service. This service is started from
> another service, which was triggered by an alarm. In regards to you
> underground issue, it's a not a problem. The service that starts this
> service will call the stopSelf method after 20 seconds, which is more
> than the 13 seconds it waits for a location.
>
> On Dec 20, 7:42 am, Mark Murphy <[email protected]> wrote:
>
>
>
> > dapaintballer331 wrote:
> > > If somebody can get this to work for me, using an emulator on the 1.5
> > > sdk, I will send them $25 via paypal if you need it. I am using the
> > > android 1.5 emulator.
>
> > > Problem: I see the satilite icon on the top of the phone, but when I
> > > send the device multiple coordinates, is never runs the
> > > onLocationChange method.
>
> > I don't think requestLocationUpdates() will work reliably from an
> > IntentService. The, um, intent of an IntentService is for it to shut
> > down (via stopSelf()) after it has exhausted its queue of work.
>
> > Also, I don't see where an IntentService will be called with onStop().
> > You might want to slap an @Override on there to confirm. If it does not
> > exist, as I suspect, then you will never release your location listener,
> > and that is seriously bad with an IntentService.
>
> > My guess is that you're trying to create a scheduled task, triggered by
> > an alarm, that will look up the current location and do something with
> > it. While the IntentService (Wakeful or otherwise) is normally a fine
> > answer, I suspect that it will give you loads of problems in this case,
> > since it automatically stops when the Intent is delivered and consumed.
> > You will probably need to fall back to a regular service, calling
> > stopSelf() after you have gotten your location fix, and using a WakeLock
> > to keep yourself awake in the interim. Even then, things could get a bit
> > icky (e.g., what if the user is underground and you never get a fix?).
>
> > --
> > Mark Murphy (a Commons
> > Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> > Android 1.6 Programming Books:http://commonsware.com/books
--
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