Me too I am having a few problems with proximityalerts. That is my
loop for add the locations.

    for (..){
      Intent proxIntent = new Intent("<my
package>.action.PROXIMITY_ALERT");
      mProximityPending[i] = PendingIntent.getBroadcast(this, i,
proxIntent, PendingIntent.FLAG_CANCEL_CURREN);
      // add proximity alerts
      lm.addProximityAlert(flat,flon,RADIUS_ALERT,
3600000,mProximityPending[i]);
   }

For a few locations the events (in and out) are fired correctly into
my BroadcastRecevier class:

public class GoMeeListener extends BroadcastReceiver {
        @Override
        public void onReceive(Context context, Intent intent) {
                String intentAction = intent.getAction();

        if (intentAction.equals("<my
package>.action.PROXIMITY_ALERT")) {
            Bundle b=intent.getExtras();
            boolean bIn=b.getBoolean
(LocationManager.KEY_PROXIMITY_ENTERING, false);
            if (bIn)
                Log.d("DEBUG", "IN");
            else
                Log.d("DEBUG", "OUT");
        }
    }
}


But for other locations are not fired, looking the LogCat window I
seen those exception, out of my code:

01-24 14:54:11.463: INFO/LocationManagerService(48): Entered alert
01-24 14:54:11.703: DEBUG/dalvikvm(48): GC freed 15501 objects /
600600 bytes in 232ms
01-24 14:54:11.713: INFO/LocationManagerService(48): Canceled
proximity alert: com.android.server.LocationManagerService
$proximityal...@435102d0
01-24 14:54:11.713: INFO/LocationManagerService(48):
android.app.PendingIntent$CanceledException
01-24 14:54:11.713: INFO/LocationManagerService(48):     at
android.app.PendingIntent.send(PendingIntent.java:376)
01-24 14:54:11.713: INFO/LocationManagerService(48):     at
com.android.server.LocationManagerService
$ProximityListener.onLocationChanged(LocationManagerService.java:1015)
01-24 14:54:11.713: INFO/LocationManagerService(48):     at
com.android.server.LocationManagerService.handleLocationChanged
(LocationManagerService.java:1367)
01-24 14:54:11.713: INFO/LocationManagerService(48):     at
com.android.server.LocationManagerService.access$1200
(LocationManagerService.java:80)
01-24 14:54:11.713: INFO/LocationManagerService(48):     at
com.android.server.LocationManagerService
$LocationWorkerHandler.handleMessage(LocationManagerService.java:1414)
01-24 14:54:11.713: INFO/LocationManagerService(48):     at
android.os.Handler.dispatchMessage(Handler.java:88)
01-24 14:54:11.713: INFO/LocationManagerService(48):     at
android.os.Looper.loop(Looper.java:123)
01-24 14:54:11.713: INFO/LocationManagerService(48):     at
com.android.server.ServerThread.run(SystemServer.java:308)
01-24 14:54:11.713: INFO/LocationManagerService(48): Entered alert
01-24 14:54:11.722: ERROR/LocationManagerService(48): Exception in
LocationWorkerHandler.handleMessage:
01-24 14:54:11.722: ERROR/LocationManagerService(48):
java.lang.NullPointerException
01-24 14:54:11.722: ERROR/LocationManagerService(48):     at
com.android.server.LocationManagerService
$ProximityListener.onLocationChanged(LocationManagerService.java:1015)
01-24 14:54:11.722: ERROR/LocationManagerService(48):     at
com.android.server.LocationManagerService.handleLocationChanged
(LocationManagerService.java:1367)
01-24 14:54:11.722: ERROR/LocationManagerService(48):     at
com.android.server.LocationManagerService.access$1200
(LocationManagerService.java:80)
01-24 14:54:11.722: ERROR/LocationManagerService(48):     at
com.android.server.LocationManagerService
$LocationWorkerHandler.handleMessage(LocationManagerService.java:1414)
01-24 14:54:11.722: ERROR/LocationManagerService(48):     at
android.os.Handler.dispatchMessage(Handler.java:88)
01-24 14:54:11.722: ERROR/LocationManagerService(48):     at
android.os.Looper.loop(Looper.java:123)
01-24 14:54:11.722: ERROR/LocationManagerService(48):     at
com.android.server.ServerThread.run(SystemServer.java:308)
01-24 14:54:11.863: VERBOSE/DumpStateReceiver(48): Running: /system/
bin/dumpcrash
01-24 14:54:12.203: INFO/DumpStateReceiver(48): Finished: 1769 bytes
read; status 0
01-24 14:54:12.232: INFO/DumpStateReceiver(48): Added state dump to 1
crashes


Anyone can help me ?

thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to