Van a probléma, hogy ha meg kell kérni egy címet a geocoder.getFromLocationName ( „California”, 1) függvény, hogy megalapítja a cím, de ha azt tesztelni a készüléken (Xiaomi MI5, Oreo) ad vissza üres lista.
Előre is köszönöm!
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);
}
}













