Code example for LocationManager

Methods: removeGpsStatusListenerremoveUpdates

0
    protected void onPause() { 
        super.onPause(); 
 
        if (locationManager != null) {
            // remove both the delegates to stop the GPS 
            locationManager.removeGpsStatusListener(gpsListener);
            locationManager.removeUpdates(gpsListener);
            locationManager = null; // dont need this anymore
        } 
    } 
 
    /** 
     * updates the view from the data in the model 
     */ 
    private void updateView() { 
 
        // update all data in the UI 
        latitudeText.setText(Double.toString(latitude));
        longitudeText.setText(Double.toString(longitude));
        qualityText.setText(getGrade());
        satsTotal.setText(Integer.toString(satellitesTotal));