IT/Android
Geocoder - getFromLocation() deprecated 해결
은정21
2023. 5. 16. 12:23
반응형
getFromLocation(double latitude, double longitude, int maxResults) 메소드가 API33에서 Deprecated되었다.
getFromLocation(double latitude, double longitude, int maxResults, android.location.Geocoder.GeocodeListener) 를 대신 사용하면 된다.
//Fetch address from location
geocoder.getFromLocation(latitude,longitude,maxResult,object : Geocoder.GeocodeListener{
override fun onGeocode(addresses: MutableList<Address>) {
// code
}
override fun onError(errorMessage: String?) {
super.onError(errorMessage)
}
})
https://developer.android.com/reference/android/location/Geocoder
https://stackoverflow.com/questions/73456748/geocoder-getfromlocation-deprecated