getting location from a background service, is this correct?
<p>I have a background service that is getting updates from the location manager every 5 minutes. When on locationChaged is called, I call a function in my activity to update the GeoPoint that holds my user location. This is working fine and does what I want. I am just unsure if it is better to use something like broadcast receivers to do this. I have tried using a broadcast receiver but it is not working. Is there anything incorrect with the way I am currently doing this?</p>

<p>I have the following methods in my location service:</p>

<pre><code>public static double getLat() {
    return lat;
}

public static double getLng() {
    return lng;
}

public void onLocationChanged(Location loc) {        
    lat = (double) (loc.getLatitude());
    lng = (double) (loc.getLongitude());
    mapview.locationHasChanged();
}
</code></pre>

<p>And in my bound activity I have the following:</p>

<pre><code>public static void locationHasChanged() {

    double myLat = LocationService.getLat();
    double myLng = LocationService.getLng();

    LocGeo = new GeoPoint(
            (int) (myLat * 1E6),
            (int) (myLng * 1E6));
}
</code></pre>
