默认的Android时区列表 [英] Default Android Time zone List
问题描述
我在想,如果我能得到的地方默认code时区选择列表为Android 2.3.3版本?
I was wondering if i can get somewhere the default code for time zone selection list for android version 2.3.3?
推荐答案
不幸的是,Android设置需要从XML包含在设置应用程序时区列表。你可以看到这个<一个href=\"http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android-apps/1.6_r2/com/android/settings/ZoneList.java\">source code (行161):
Unfortunately, Android settings takes that timezone list from an XML included in the Settings application. You can see this in the source code (line 161):
private List<HashMap> getZones() {
List<HashMap> myData = new ArrayList<HashMap>();
long date = Calendar.getInstance().getTimeInMillis();
try {
XmlResourceParser xrp = getResources().getXml(R.xml.timezones);
...
}
其他的应用程序,如谷歌日历,有自己的价值观的数组。它可以通过执行扭转这些工程进行检查资源。
所以,除非你想保持自己的列表(考虑多语言考虑...),我建议你有通过的 java.util.TimeZone中并只显示你想要的时区来,因为@Raghunandan建议大家在他的答案的评论。
So, unless you want to maintain your own list (taking multilanguage into consideration...), I'd recommend you to have a reduced list of that provided by java.util.TimeZone and show only those timezones you want to, as @Raghunandan recommended you in his answer's comment.
这篇关于默认的Android时区列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!