weired android error on GPS Manager
<p>I am trying to find out this problem without much luck for last couple of days. basically my gps listener is registered like this for getting gps events:</p>

<pre><code>    private void registerForNotifications(int gpsActivationIntervalMillis) {
    // gps satellite based
    gpsLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, gpsActivationIntervalMillis, AppSettings.getMinimumDistance(),gpsLocationListener);
    gpsLocationManager.addGpsStatusListener(gpsLocationListener);
}
</code></pre>

<p>and it unregisters with this code: </p>

<pre><code>    private void unRegisterForNotifications() {
    gpsLocationManager.removeUpdates(gpsLocationListener);
    gpsLocationManager.removeGpsStatusListener(gpsLocationListener);        
}
</code></pre>

<p>This is done on a background service and runs perfectly. But when I try to change the interval by doing an unregister &amp; register with different interval: </p>

<p>private void  restart() {
   registerForNotification(interval);
    unRegisterForNotification();
}</p>

<p>, I run into this: </p>

<blockquote>
  <p>05-21 13:12:56.354: WARN/MessageQueue(7290): Handler{460f47a8} sending message to a Handler on a dead thread
  05-21 13:12:56.354: WARN/MessageQueue(7290): java.lang.RuntimeException: Handler{460f47a8} sending message to a Handler on a dead thread
  05-21 13:12:56.354: WARN/MessageQueue(7290):     at android.os.MessageQueue.enqueueMessage(MessageQueue.java:179)
  05-21 13:12:56.354: WARN/MessageQueue(7290):     at android.os.Handler.sendMessageAtTime(Handler.java:457)
  05-21 13:12:56.354: WARN/MessageQueue(7290):     at android.os.Handler.sendMessageDelayed(Handler.java:430)
  05-21 13:12:56.354: WARN/MessageQueue(7290):     at android.os.Handler.sendMessage(Handler.java:367)
  05-21 13:12:56.354: WARN/MessageQueue(7290):     at android.location.LocationManager$ListenerTransport.onLocationChanged(LocationManager.java:157)
  05-21 13:12:56.354: WARN/MessageQueue(7290):     at android.location.ILocationListener$Stub.onTransact(ILocationListener.java:58)
  05-21 13:12:56.354: WARN/MessageQueue(7290):     at android.os.Binder.execTransact(Binder.java:288)
  05-21 13:12:56.354: WARN/MessageQueue(7290):     at dalvik.system.NativeStart.run(Native Method)
  Blockquote</p>
</blockquote>

<p>Looks like some dead activity/handler problem, but isn't android supposed to handle this? How am I supposed to properly change the gps subscription process?</p>
