Unregisters provided listener from the LocationManager . - Android Map

Android examples for Map:Location

Description

Unregisters provided listener from the LocationManager .

Demo Code


//package com.java2s;
import android.content.Context;
import android.location.LocationListener;
import android.location.LocationManager;

public class Main {
    /**/*  w  w  w.  ja va2 s  . com*/
     * Unregisters provided {@code listener} from the {@link LocationManager}.
     */
    public static void unregister(Context context, LocationListener listener) {
        final LocationManager locationManager = (LocationManager) context
                .getSystemService(Context.LOCATION_SERVICE);
        locationManager.removeUpdates(listener);
    }
}

Related Tutorials