kar*_*hik 2 android google-api
任何人都可以帮助我获得一份国家名单和一份他们的城市名单吗?是否有任何用于获取这些列表的 google Api?
试试这个:
ArrayList<String> list=new ArrayList<String>();
String[] locales = Locale.getISOCountries();
for (String countryCode : locales) {
Locale obj = new Locale("", countryCode);
System.out.println("Country Name = " + obj.getDisplayCountry());
list.add(obj.getDisplayCountry());
}
Run Code Online (Sandbox Code Playgroud)
并将列表设置为适配器。
我认为要获得城市,您必须使用网络服务。
请参阅这些链接:
| 归档时间: |
|
| 查看次数: |
4777 次 |
| 最近记录: |