You cannot edit a resource or add a resource after compiling the code. I do not know exactly what setResource does, but once your program is compiled, android builds gen files that indicate a certain amount of space for these variables, changing the variable after writing will result in memory overflow or outofbounds errors. If you want constant values ββto try using SharedPrefs, SQL, or even your own XML stored in the application directory, which you could set up as read-only by your application.
Shaun source share