learntogrow-growtolearn
learntogrow-growtolearn

Reputation: 1280

Incompatible type error Geocoder Google API

I am trying to use the geocoder API by google in Android.

Here's the code :

 private void getLatLong(String inputaddress) throws IOException {
        Geocoder mygeocoder = new Geocoder(this.getContext());
        List<Address> gclist = mygeocoder.getFromLocationName(inputaddress,1);
    }

However, I get an error:

Error: incompatible types: List<android.location.Address> cannot be converted to List<com.google.android.gms.identity.intents.Address>

While declaring the List, I am making sure that it is importing from the com.google.android.gms.identity.intents.Address , still I am getting this error. Any idea where am I going wrong? Thank you.

Upvotes: 1

Views: 688

Answers (1)

learntogrow-growtolearn
learntogrow-growtolearn

Reputation: 1280

This did the work

List<android.location.Address> gclist ;
        gclist  = mygeocoder.getFromLocationName(inputaddress,1);

Upvotes: 3

Related Questions