1

Currently, I define several theme in my app

  • R.style.Theme_MyApp_Light
  • R.style.Theme_MyApp_Dark

User has the option to save his selected theme in preference.

I was wondering, is it safe for me to save these generated Id into preference? Possible in my next app release, aapt generates different resource id?

Cheok Yan Cheng
  • 47,586
  • 132
  • 466
  • 875

1 Answers1

2

Every build the generated resource id will be different. But you can generate fixed resource ids by using public.xml . Then you can safely store resource ids in preference.

Community
  • 1
  • 1
nandeesh
  • 24,740
  • 6
  • 69
  • 79