i am having trouble with adding more then one proximity alert to my location listener. i already searched the internet but found nothing helpful. please let me know if i am doing some thing wrong . here is my code snippet
locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
locationManager.addProximityAlert(30.0, 70.0, 1000, -1, PendingIntent.getActivity(Map.this, 0, new Intent(android.content.Intent.ACTION_VIEW,Uri.parse("http://www.google.com")), 0));
locationManager.addProximityAlert(40.0, 50.0, 1000, -1, PendingIntent.getActivity(Map.this, 10, new Intent(android.content.Intent.ACTION_VIEW,Uri.parse("http://www.google.com")),0));
From my emulator control when i give 30.0 and 70.0 nothing happen but when i give 40.0 and 50.0 my pending intent trigger. i want to add both these locations to my location manager’s proximity alert
You should use
BroadcastReceiverandBroadcastMessagesto manage more thant one proximity alert. When you add the second alert40.0, 50.0, you overwrite the first alert.A good solution is here.