When I create preference activity I define all preferences in xml file. Every preference has a key defined in this xml. But when I access preference I write:
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
tag. See Localization Checklist
enable