My Main Activity is AddressFinder
, here I start a AddressController
:
AddressController ac = new AddressController();
The AddressController should update in some cases:
import android.content.Context;
....
private void updateAddresses() throws IOException {
Geocoder geocoder = new Geocoder(context);
for (Address a: address) {
List<Address> addressIn = geocoder.getFromLocation(a.getLatitude(),
a.getLongitude(), 1);
}
}
Now I have no idea which context I have to use. I don't understand how to use it. I tried this
, context
, getBaseContext()
, getApplicationContext()
but nothing worked. Furthermore i tried to give the Adresscontroller an argument with the context
(getApplicationContext
) of the main activity.