title: Android Proximity Alert - Not Triggering
body: <p>I am going crazy not getting what I am doing wrong and I am now turning to StackOverflow for help.</p>
  
  <p>I am trying to add locations with proximity alerts and when the proximity alert triggers I get a notification. I am getting location updates when moving around and I have application continiously printing my distance to the location where my proximity alert is centered. </p>
  
  <p>The issue is that the proxmity alerts never trigger. I have been using the physical device with the actual GPS when trying this.</p>
  
  <p>Code for setting the proximity alert. The toast at the end is shown so I know that this code runs.</p>
  
  <pre><code>    LocationManager locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
  
      Intent intent = new Intent(PROX_ALERT_INTENT);
      intent.putExtra(PROXIMITY_ITEM_ID, item.getID());
      PendingIntent proximityIntent = PendingIntent.getBroadcast(this, item.getID(), intent, 0);
  
      locationManager.addProximityAlert(
          item.getPlace().getLocation().latitude, // the latitude of the central point of the alert region
          item.getPlace().getLocation().longitude, // the longitude of the central point of the alert region
          200, // the radius of the central point of the alert region, in meters
          -1, // time for this proximity alert, in milliseconds, or -1 to indicate no expiration
          proximityIntent // will be used to generate an Intent to fire when entry to or exit from the alert region is detected
      );
      IntentFilter filter = new IntentFilter(PROX_ALERT_INTENT);
      this.registerReceiver(new ProximityAlertBroadcastReceiver(), filter);
      Toast.makeText(this, "Added new proximity alert event...", Toast.LENGTH_SHORT).show();
  </code></pre>
  
  <p>And then I have the code for the broadcast receiver. This code never runs so I never get the toast or the notification.</p>
  
  <pre><code>public class ProximityAlertBroadcastReceiver extends BroadcastReceiver {
  
      private void createNotification(Context context, ToDoItem todoItem) {
          NotificationCompat.Builder mBuilder =
                  new NotificationCompat.Builder(context)
                  .setSmallIcon(R.drawable.todomaps_icon)
                  .setContentTitle(todoItem.getTask())
                  .setContentText("You are " + todoItem.getDistanceString() + " to todo: " + todoItem.getTask());
  
          // Sets an ID for the notification
          int mNotificationId = 001;
          // Gets an instance of the NotificationManager service
          NotificationManager mNotifyMgr = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
          // Builds the notification and issues it.
          mNotifyMgr.notify(mNotificationId, mBuilder.build());
      }
  
      @Override
      public void onReceive(Context context, Intent intent) {
          Toast.makeText(context, "ON RECEIVE!", Toast.LENGTH_SHORT).show(); //TODO: TEMP
          int itemID = intent.getIntExtra(AddItemActivity.PROXIMITY_ITEM_ID, -1);
          DBHandler handler = new DBHandler(context);
          Item item = handler.getItem(itemID);
          createNotification(context, item);
      }
  
  }
  </code></pre>
  
  <p>I dont know if it makes a difference but the location manager instance used in the application to see the distance to the proximity alert center is a different instance that is used to create the proximity alert. So the location manager instance that created the proximity alert are not requesting location updates but I am guessing that it doesn't matter.</p>
  
  <p>Here are the permissions I use:</p>
  
  <pre><code>&lt;permission 
      android:name="com.flipsoft.todomaps.permission.MAPS_RECEIVE"
      android:protectionLevel="signature"&gt;&lt;/permission&gt;
  
  &lt;uses-permission android:name="com.flipsoft.todomaps.permission.MAPS_RECEIVE"/&gt;
  &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
  &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
  
  &lt;uses-feature
    android:glEsVersion="0x00020000"
    android:required="true"/&gt;
  </code></pre>