2016-07-19 5 views
1

Android에서 Google 지오 코더 API를 사용하려고합니다. 목록을 선언, 나는 그것이 com.google.android.gms.identity.intents.Address에서 가져 오는 것을 확인하고 있지만 아직도 내가 얻고,호환되지 않는 유형 오류 지오 코더 Google API

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

: 나는 오류가 발생, 그러나

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

: 여기

코드입니다 이 오류. 어디서 잘못 생각하나요? 감사합니다.

+2

목록 선언이 android.location.Address 타입 작업을했다. 이것을 com.google.android.gms.identity.intents.Address로 변경해보십시오. – TheAnonymous010

답변

3

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