views:

29

answers:

1

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
Is it possible to use the File class with raw resources? How do you create a File object from a resource id?
hgpc
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
Nope, that doesn't return the extension.
hgpc
Indeed i just realized it does not. I'm actually lost, sorry...
Sephy
Thanks for trying, anyway. :)
hgpc