Search code examples
androidandroid-xml

Android Dynamically Add Item to Array XML Resource


Is there any way I can add items in code to a String-Array resource? For instance, if I want to create a spinner that shows the user values, and I want to allow the user to add their own custom values.


Solution

  • No. this is not supported because resources are packaged in the binary .apk and as such cannot be changed.

    Don't follow this design pattern, change your approach.