8

I'm looking to have a user select an image from the gallery, and have this file saved as a permanent drawable resource when they open the app at a later time. Is this possible?

I mean as an object in the actual drawable folder.

RBT
  • 24,161
  • 21
  • 159
  • 240
Bisclavret
  • 1,327
  • 9
  • 37
  • 65
  • After A Long Search , I found it's not allowed to do that. Check this Answer from more [info](https://stackoverflow.com/a/3374149/3474171) – AbdullahADhaim Jul 11 '15 at 02:44
  • Does this answer your question? [Write to /res/drawable/ on the fly?](https://stackoverflow.com/questions/3374061/write-to-res-drawable-on-the-fly) – RBT Jan 05 '20 at 03:28
  • Hello, is there official documention about this? thanks! – jvargas Jul 09 '20 at 20:53

2 Answers2

9

No, it's not possible. "The drawable folder" doesn't exist as a file system folder at runtime - it's part of your (read-only) binary .apk file.

GreyBeardedGeek
  • 29,460
  • 2
  • 47
  • 67
2

You could instead save the image at internal folder and/or define a preference string. Check this old answer https://stackoverflow.com/a/3374138/4618976

Community
  • 1
  • 1
Roberto Tellez Ibarra
  • 2,146
  • 3
  • 18
  • 34