title: Location changed notification android
body: <p>I am just testing out the onLocationChanged method in Android , I have implemented a way that when I click a button the app returns a String with the new lat and lng values. But now I am trying to show the results automatically every time the location changes. This is what I have so far to do so:</p>
  <pre><code>location manager
  
  public void onCreate(Bundle savedInstanceState) 
  {
  super.onCreate(savedInstanceState);   
  
  int minTime = 30000;
  LocationManager locationManager = (LocationManager)this.getSystemService(Context.LOCATION_SERVICE);
  Criteria criteria = new Criteria();
  MyLocationListener myLocListener = new MyLocationListener();
  criteria.setPowerRequirement(Criteria.POWER_LOW);
  criteria.setAccuracy(Criteria.ACCURACY_FINE);
  criteria.setAltitudeRequired(false);
  criteria.setBearingRequired(false);
  criteria.setCostAllowed(true);
  criteria.setSpeedRequired(false);
  String bestProvider = locationManager.getBestProvider(criteria, false);
  
  locationManager.requestLocationUpdates(bestProvider, minTime, 1, myLocListener );
  </code></pre>
  <p>onlocationchanged</p>
  <pre><code>public void onLocationChanged(Location loc) {
  
    if(loc != null){
  
    lat1 = loc.getLatitude();
    lng1 = loc.getLongitude();
    
    currentlocation = &quot;Location changed to lat: &quot; + lat + &quot;&quot; + &quot;lng: &quot; + lng1 ;
  
      Context context = getApplicationContext();
      CharSequence text = currentlocation;
      int duration = Toast.LENGTH_LONG;
  
      Toast toast = Toast.makeText(context, text, duration);
      toast.show();
     
    
    }
  </code></pre>
  <p>}</p>
  <p>I have set the requestlocationupdates method to request and update every 60000 millseconds
  My problem is that the application never toasts the lat and lng values when the location changes. I have tested the app with the emulator and tried telneting the lat and lng values. And I have also drove around in my car to see if the values change.</p>