Code example for LocationListener

Methods: onLocationChanged

0
    private class MyLocationListener implements LocationListener {
 
        @Override 
        public void onLocationChanged(Location location) {
            if (mLocationListener != null) {
                mLocationListener.onLocationChanged(location);
            } 
             
            if (shouldAcceptLocation(location)) {
                reportLocationFound(location);
                removeUpdates(); 
            } 
        } 
 
        @Override 
        public void onProviderDisabled(String provider) {
            // Needed by the interface. 
             
        } 
 
        @Override