How to get URI from an asset File?

后端 未结 11 1658
慢半拍i
慢半拍i 2020-11-22 14:27

I have been trying to get the URI path for an asset file.

uri = Uri.fromFile(new File(\"//assets/mydemo.txt\"));

When I check if the file

11条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 14:46

    try this :

    Uri uri = Uri.parse("android.resource://"+getPackageName()+"/"+R.raw.cat); 
    

    I had did it and it worked

提交回复
热议问题