Tuesday, October 19, 2010

[android-developers] Registering for proximity alert doesn't work for more than one Location.

Hi all.

I am trying to register to several proximity alerts.

Here's an excerpt:

FOR EACH location:
{
Intent intent = new Intent(context,
Service_locationUpdated.class);

// remember which location is it

intent.putExtra(Service_locationUpdated.MSG_LOCATION_UPDATED_EXTRA_LOCATION_ID,
locationInformation.getInternalID());

// prepare new
PendingIntent pIntent = PendingIntent.getService(aApplication,
0,
intent,
0);

lm.addProximityAlert(location.getLatitude(),
location.getLongitude(),
location.getRadius(),
-1L, pIntent);
}

And when I change the location, the service doesn't get started :(

BUT ! if i put a break; after adding only one proximityAlert,
everything works just fine.

So does anyone have a clue why it works for one and not for more
locations?
Am I missing a flag or something while creating the intents ?

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate