开发者

cant find files written to device

开发者 https://www.devze.com 2023-02-20 12:44 出处:网络
I am using outStream = ctext.openFileOutput(\"demo.jpg\",0); outStream.write(data); outStream.close(); If I use the emulator the file is written to the data hieracrchy on the simulated sdcard.

I am using outStream = ctext.openFileOutput("demo.jpg",0); outStream.write(data); outStream.close();

If I use the emulator the file is written to the data hieracrchy on the simulated sdcard.

When I run on my Samsung 15500 I cant find where the data has been written to. If I click on MyFiles I can see the directories under Android with a data subdir but no sign of the file.

Am I missing something either in 开发者_如何学Gothe method of writing the file or the way to find it on the device.


You should be able to find it via Context.getFileList();. The docs to Context.openFileOutput() say

Open a private file associated with this Context's application package for writing

So I guess there is no "guarantee" that you can have arbitrary access to it via file paths or urls or such.

0

精彩评论

暂无评论...
验证码 换一张
取 消