In my app i have saved some values as integer.I'm going to show that values in EditTextPreference in preference page ,but throw exception because value is int not string . is there any workaround to show(or maybe store) integer value in EditTextPreference ?
with(sharedPref.edit()) {
putLong( context.getString(R.string.preference_update_date_key),Date().time)
putInt(context.getString(R.string.preference_register_key),code)
apply()
}
.
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory app:title="@string/quiz_setting_messages_header">
<EditTextPreference
app:key="@string/preference_update_date_key"
app:title="@string/date_val"
app:useSimpleSummaryProvider="true" />
<EditTextPreference
app:key="@string/preference_register_key"
app:title="@string/regkey"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
<PreferenceScreen/>