Where to store Android preference keys?
- by pixel
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:
SharedPreferences appPreferences = PreferenceManager.getDefaultSharedPreferences(this);
boolean foo_value = appPreferences.getBoolean("foo_key_defined_in_xml", false);
Is there any way to avoid acessing "foo_key_defined_in_xml" in hard-coded way?
Maybe there is a possibility to access it in R style way?