Code example for LocationManager

Methods: removeGpsStatusListenerremoveUpdates

0
        locationManager.requestLocationUpdates(provider, minTime, minDistance,this);
    } 
 
    public void stopProvider() { 
        try{ 
            locationManager.removeUpdates(this);
            locationManager.removeGpsStatusListener(gpsStatusListener);
        } 
        catch(IllegalArgumentException ex) {}
 
    } 
 
    public void onDestroy() { 
        stopProvider(); 
    } 
 
 
    public void onLocationChanged(Location location) {
        //Send new GPS result to our listener 
        listener.gpsLocationChanged(location);
Connect your IDE to all the code out there  Get Codota for Java