I’m designing a method for storing some values in a SharedPreferences that relate to a set of Views. The method is going to be run by a bunch of subclasses, so I need a simple way to store the names of the preferences, and I’m considering using the R.id values for the views, since I already have them in an ArrayList for another method. I’m a bit concerned however that those values might change between runs, which would effectively invalidate the stored preferences. Do they ever change outside of development?
I’m designing a method for storing some values in a SharedPreferences that relate to
Share
Neither, they’re changed between compilations.
R is a class that is generated automatically during the build process of the application. Then compiled and serves as a normal class in your application.
From Android docs – Accessing Resources: