title: Proximity alerts are firing even I exit the set GPS location and occuring every 2 or 1 minute reccursively
body: <p>I recently started working on proximity alerts App. This basically changes the ringtone profile (just vibrate or ringtone intially) based on the users GPS location. I completed the coding part. On "enter" and "exit" Proximity alerts are getting fired and the code in registered BroadcastReceiver is been executing. Till this point it is fine. Actual problem is as follows, (with my sample code lines)</p>
  
  <p>I registered one broadcastreceiver for two Intent actions. Those Intent actions are declared as below,
    public static final String INTENT_ACTION1 = "org.droidmania.action.<strong>PROXIMITYALERT</strong>";
    public static final String INTENT_ACTION2 = "org.droidmania.action.<strong>PROXIMITYALERT2</strong>";</p>
  
  <p>And PendingIntent part is as,</p>
  
  <p>private void setProximityAlerts(String intentAction){
   Intent intent = new Intent();
   intent.setAction(intentAction);
   <strong>//in case the call comes from HomeActivity intentAction will be INTENT_ACTION1 else INTENT_ACTION2</strong></p>
  
  <p>PendingIntent pIntent = PendingIntent.getBroascast(context, 0, intent,
                      PendingIntent.FLAG_CANCEL_CURRENT);</p>
  
  <p>locationManager.addProximityAlert(latitude,longitude, vRadius, -1,pIntent);
  }</p>
  
  <p>Now the BroadcastReceiver code,</p>
  
  <p>class ProxyReceiver extends BroadcastReceiver{
     @Override
     public void onReceive(Context context,Intent intent){<br>
       boolean isEnter = intent.getBooleanExtra(KEY_PROXIMITY_ENTERING,false);</p>
  
  <pre><code>if(isEnter){
    **//if user is in Home location**
     if(intent.getAction().equals(INTENT_ACTION1)){  
       give the notification that user is in home area
    }
   **//if user is in Office location**
   if(intent.getAction().equals(INTENT_ACTION2)){
       give the notification that user is in office area
   }
  </code></pre>
  
  <p>}
     else{
         <strong>//if user is out of Home location</strong><br>
         if(intent.getAction().equals(INTENT_ACTION1)){<br>
           give the notification that user is out of home area
        }
       <strong>//if user is out of Office location</strong>
       if(intent.getAction().equals(INTENT_ACTION2)){
           give the notification that user is out of office area
       }
     } 
  }</p>
  
  <p>This is the way I tested it on my mobile device,</p>
  
  <ol>
  <li><p>In home I set the gps location with 10m radius. It gave me notification that "user is in home area"</p></li>
  <li><p>It shown "user exited the home area" message when I am out of that radius.</p></li>
  <li><p>Now when I am in office I set the gps location with 5m radius. So It gave me notification that "user is in office area". <strong>But here I am facing the actual problem</strong> as It is showing <strong>both "home area entered" and "office area entered" and "home area exited " and "office area exited" messages for every 2 or 1 minute(s) gap. I am not getting why it is happening.</strong>  (Even I am not moving around after I set the office location GPS..just staying there in the same point......sitting in my office desk seat...)</p>
  
  <p>Am I missing or giving something extra here? Why the alerts are occuring for home proximity as it's been long time since I exited the home area?</p>
  
  <p>Guys please help me out (It's been already 2 weeks of time I spent :-( ). Your help is appreciated. </p></li>
  </ol>
  
  <p>Thanks.</p>