Where to store Android preference keys?

I’ve found that it’s possible to store keys in strings.xml and refer to them from preferences.xml just like all other values android:key="@string/preference_enable".

In code you can refer to key by typing getString(R.string.preference_enable)

You can mark the string to not be translated using a <xliff:g> tag. See Localization Checklist

<string name="preference_enable"><xliff:g id="preference_key">enable</xliff:g></string>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)