2017-07-30 39 views
0

我用下面的代碼獲取的建議列表,如果用戶試圖在我的應用程序來查找地址:Android的地理編碼器只返回一個地址

String locationName = "Berli" 
if (Geocoder.isPresent()) { 
    Geocoder geocoder = new Geocoder(getBaseContext(), Locale.getDefault()); 
    List<Address> list = geocoder.getFromLocationName(locationName, 5); 
} 

但它僅返回「Berli,印度」作爲我的列表中的單個條目 - 而不是像「柏林,德國」等其他可能的地址。當我嘗試其他許多地方時,只顯示一條建議。這是Geocoder的正確行爲還是我應該使用其他解決方案?

非常感謝, 克里斯

+0

https://stackoverflow.com/a/13310210/2700586 – Mani

回答

相關問題