Android GPS:返回国家名称,但未翻译
在我的功能中,我正在读取用户位置的数据:Android GPS:返回国家名称,但未翻译,android,gps,Android,Gps,在我的功能中,我正在读取用户位置的数据: public async void OnLocationChanged(Location location) { _currentLocation = location; Address address = await ReverseGeocodeCurrentLocation(); Account.Instance.Locality = address.Locality;
public async void OnLocationChanged(Location location)
{
_currentLocation = location;
Address address = await ReverseGeocodeCurrentLocation();
Account.Instance.Locality = address.Locality;
Account.Instance.Country = address.CountryName;
Account.Instance.CountryCode = address.CountryCode;
}
但是地址和所有东西都是用德语寄回来的,因为我住在德国。但我需要的是英语。有没有比进行210字符串比较更好的方法
谢谢:)
请参阅。您能给我看看您的
反向存储当前位置的方法吗?如果您正在使用Geocode
请尝试此Geocoder-Geocoder=new-Geocoder(Context,Locale.ENGLISH)代码>精彩。这就成功了!
Geocoder geocoder = new Geocoder(Context, Locale.ENGLISH);