GeoCoder
GoogleMapApi의 주소 양식을 검색하고 그 결과를 Spinner
개체 앞에 전달하기 전에 목록에서 모든 null 항목을 제거해야합니다.ArrayList에서 null 항목 제거
private List<Address> getAddress(double latitude, double longitude,int maxResults) {
Geocoder gCoder = new Geocoder(getApplicationContext(),Locale.getDefault());
try {
locs = gCoder.getFromLocation(latitude, longitude, maxResults);
locs.removeAll(Arrays.asList("", null));
//locs.removeAll(Collections.singleton(null));
} catch (IOException e) {
e.printStackTrace();
}
return locs;
}
제 생각에는 확실히 작동해야합니다. 별도의 목록으로 시도 했습니까? –