Is it possible to get the extension of a raw resource in Android? How?
A:
maybe if you are using the File
class, you could use this method getAbsolutePath()
which will give you the absolute path, and from that you use a regexp to retrieve the last characters preceded by a "."
Sephy
2010-08-10 14:32:07
Is it possible to use the File class with raw resources? How do you create a File object from a resource id?
hgpc
2010-08-10 14:33:15
True, I did not realize that this was from the raw resource folder but from a row resource in general. I think you could use this from the `Resources` class : `getResourceName()` http://developer.android.com/reference/android/content/res/Resources.html#getResourceName%28int%29
Sephy
2010-08-10 15:37:13
Nope, that doesn't return the extension.
hgpc
2010-08-10 15:41:47
Indeed i just realized it does not. I'm actually lost, sorry...
Sephy
2010-08-10 15:52:12
Thanks for trying, anyway. :)
hgpc
2010-08-11 13:08:51