Ben geocoder.getFromLocationName ( California, 1) işlevi ile bir adresi elde etmeye çalışmak, eğer adresini kurar böyle bir sorun ama benim cihazı (Xiaomi Mi5, Oreo) üzerinde test eğer boş bir listesini döndürür.
Şimdiden teşekkürler!
private void geoLocate(){
Log.d(TAG, geoLocate: geolocating);
String searchString = mSearchText.getText().toString();
Log.d(TAG, geoLocate: Searching for + searchString);
Geocoder geocoder = new Geocoder(this);
List<Address> list = new ArrayList<>();
try{
if(geocoder.isPresent()){
list = geocoder.getFromLocationName(searchString,1);
} else{
Log.d(TAG, geoLocate: GEOCODER IS NOT PRESENT);
}
}catch (IOException e){
Log.e(TAG, geoLocate: IOException + e.getMessage() );
}
if(list.size() > 0 ){
Address address = list.get(0);
Log.d(TAG, geoLocate: found a location: + address.toString());
}else{
Log.d(TAG, geoLocate: Location not found);
}
}













