使用raw文件夹下的资源的方式如下:
String uriStr = "android.resource://"+getPackageName()+"/"+ R.raw.abc;
我遇到的问题是,android studio会报错:
The file is not associated with any file type.Please define the association;
解决办法是:
在gradle.properties中,添加一行代码:
android.enableAapt2 = false