我正在编写我的第一个Android应用程序,并且正在尝试读取res/raw
资源文件。openRawResourceFd在Android上失败
下面的代码throws
一个FileNotFound
例外:
AssetFileDescriptor fd = res.openRawResourceFd(R.raw.myfile);
,但此行的代码的工作:
InputStream stream = res.openRawResource (R.raw.myfile);
我需要AssetFileDescriptor
,以确定该文件的长度。任何想法,为什么它不工作?
你有没有找到办法做到这一点? –