Android: how do I create File object from asset file?

后端 未结 3 556
时光说笑
时光说笑 2020-12-03 07:28

I have a text file in the assets folder that I need to turn into a File object (not into InputStream). When I tried this, I got \"no such file\" exception:

S         


        
3条回答
  •  再見小時候
    2020-12-03 07:38

    You cannot get a File object directly from an asset, because the asset is not stored as a file. You will need to copy the asset to a file, then get a File object on your copy.

提交回复
热议问题