Issue
How do you detect what kind of file the resource is? In my case there could be videos and images.
So in case it's a video, I use a VideoView
; and in the case of an image, I use an ImageView
?
I'm getting the resource id like this:
AssetFileDescriptor afd = context.getResources().openRawResourceFd(resourceID);
Solution
I think it's impossible without reading/ analyzing the binary data of files (like TrID). The easiest way is to prefix file names with predefined strings. For example:
video_file_00
,video_file_01
…image_file_00
,image_file_01
…
Then you can use getResourceName(int)
to parse the file names.
Answered By - user1521536
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.