我是Java Android新手。从国家代码获取国家/地区名称字符串int
我想在Locale得到使用国家代码的国家名称(字符串)(参考ISO 3166-1 numeric)
试图做类似的东西(其中[...]。getCountry()的返回INT 826 ):
Locale countryName = new Locale("", String.valueOf(profile.getPersonnalInformation().getAddress().getCountry()));
并使用此得到国家的名字:countryName.getDisplayCountry()
应该正常返回我“英国”但不幸的是我有826
我该怎么做?
在提前感谢你的帮助,
HTTPS ://stackoverflow.com/questions/14275868/get-country-name-from-country-code –
@MehdiKhademloo谢谢你,但我尝试用int数做,而不是像你的例子中的字符串。我已经尝试在String中投射我的int并使用它,但它不起作用,所以你的链接不能帮助我。在您发布之前,我已经阅读过它。 –