Android, how to change activity field from LocationListener.onlocationchanged()?
<p>How do I change an activity field from LocationListener.onlocationchanged() ? I suppose I have to use a handler, but don't know how to do it, exactly...
My code is like this:</p>

<pre><code>public class Main extends Activity {
    private Double lat, lon;
    private LocationManager locationManager;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
        LocationListener locationListenerGps = new CurrentLocationGps();
        locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListenerGps);
    }
}

public class CurrentLocationGps implements LocationListener {
    @Override
    public void onLocationChanged(Location loc) {
        lat = loc.getLatitude();
        lon = loc.getLongitude();
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;---&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; How do I pass this values to Main activity fields?
    }
}
</code></pre>

<p>}</p>
