Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 android 应用程序中有一些文件作为资源。
另一方面,我有一些方法需要“文件”对象作为参数。
我该如何桥接两者?
编辑:我需要一些方法来拥有一个“文件”对象,而不是将文件作为输入流读取。谢谢你!
You could copy the file to external storage (reading from your raw resource's InputStream and writing to a new file) and then open it as a File from there. That's kludgy, but I'm pretty sure there's no way to get the resource as a File directly.
InputStream
File