So I\'m working out my first multi-threaded application using Android with the AsyncTask class. I\'m trying to use it to fire off a Geocoder in a second thread, then update
If doesn't look like you are using the params. You could use that to pass in the Conetxt.
public class GeoCode extends AsyncTask {
@Override
protected GeoThread doInBackground(Context... params) {
List addresses = null;
Geocoder geoCode = null;
geoCode = new Geocoder(params[0]); //Expects at minimum Geocoder(Context context);
addresses = geoCode.getFromLocation(GoldenHour.lat, GoldenHour.lng, 1);
}
}
Then from within your activity:
GeoCode myGeoCode = new GeoCode();
myGeoCode.execute(this);