I have number of drawables
to select in a View
. When the user selects one of the drawable
and on next time when the app is launch , I have to show only the selected drawable.
Is it good to store the Resource ID
in shared preference and retrieve the selected drawable using Resource ID
next time when the app is launched.?
All the R class related ids are generated at compile time so they won't change at runtime. There's nothing stopping you from storing this IDs in SharedPreferences, however, there's no gain whatsoever. It's almost always faster just to reference the R.drawable.x related id.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With