Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我知道如何在ListPreference.
ListPreference
我也知道如何设置哪个项目是默认的。
但我找不到ListPreference.setDefaultValue().
ListPreference.setDefaultValue()
有没有办法在运行时确定哪个是当前默认值item?(最好是它在 0 中的索引ListPreference)
item
您可以使用
String value = listPreference.getValue(); int index = listPreference.findIndexOfValue(value);
根据 w3c 标准,我的 xml 文件显然是正确的。但是,将它们发送到系统(不是我的)我得到一个错误。我试图通过http://www.xmlvalidation.com/站点验证它们并收到此错误:
XML 文档中的错误:1:1 prolog