如何决定是否使用此命令:
<com.package.CheckBoxPreference
android:defaultValue="true"
android:key="time12"
android:title="@string/ar_title"
android:summaryOn="@string/ar_sum_on"
android:summaryOff="@string/ar_sum_off"/>或者使用:
<CheckBoxPreference
android:defaultValue="true"
android:key="time12"
android:title="@string/ar_title"
android:summaryOn="@string/ar_sum_on"
android:summaryOff="@string/ar_sum_off"/>在运行时?我的意思是preference activity onCreate方法?
发布于 2015-01-21 06:38:28
您需要在两个位置使用相同的类。
如果在XML中使用com.package.CheckBoxPreference,那么也应该在PreferenceActivity中使用com.package.CheckBoxPreference。
如果在XML中使用常用的CheckBoxPreference,则应该确保在PreferenceActivity中使用android.preference.CheckBoxPreference。
https://stackoverflow.com/questions/28056384
复制相似问题