1

我在 android 应用程序中有一些文件作为资源。

另一方面,我有一些方法需要“文件”对象作为参数。

我该如何桥接两者?

编辑:我需要一些方法来拥有一个“文件”对象,而不是将文件作为输入流读取。谢谢你!

4

1 回答 1

0

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.

于 2012-06-25T22:42:14.370 回答