I have .ogg files in res/raw, I have implemented a feature to save file to sdcard, and I want to set file name from original file.
It should work with resources.getResourceName( );
Use Resources.getResourceName(id)
to get package:type/entryname
, or Resources.getResourceEntryName(id)
to get entry name (file name.)
If you're looking for the name from a resource ID, you can use Resources.getResourceName(). You can get the Resources object using Context.getResources()
.
Personally, I'd rather store an array of strings in your strings.xml and map that to the resource IDs, but it depends on what you're really trying to accomplish.
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