Android的SD卡创建的文件不可见 [英] Android SD card created file not visible

查看:940
本文介绍了Android的SD卡创建的文件不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建使用下面的code在SD卡中的文件:

I've created a file in the SD card using the code below:

File outputFile = new File( Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "test.jpg" );
outputFile.createNewFile();
OutputStream outputStream = new FileOutputStream( outputFile );
mBitmap.compress( Bitmap.CompressFormat.JPEG, 95, outputStream );
outputStream.flush();
outputStream.close ();

当我尝试看看在我的电脑(手机通过USB接口连接),此文件的浏览,通过Windows资源管理器SD卡的内容,所有SD卡的文件夹和文件显示,除了我的。天文显示该文件,但不能作为缩略图。

When I try to see this file browsing SD card contents through Windows Explorer in my computer (phone connected via USB), all SD card folders and files are displayed, except mine. Astro displays the file, but not as a thumbnail.

奇怪的是,这种情况只能用我的手机(三星的Galaxy X手机)之一,如果我重新启动这个电话,是在Windows资源管理器,并在天文缩略图显示这两个文件。

Strangest thing is that this happens only with one of my phones (a Samsung Galaxy X phone), and if I reboot this phone, file is displayed both within Windows Explorer and as a thumbnail in Astro.

莫不是在code我写的东西错或丢失?

Could there be something wrong or missing in the code I wrote?

感谢

推荐答案

也许背后有某些Windows缓存,以不连续轮询目录列表。尝试按F5在资源管理器,看看文件中出现。在任何情况下,文件应该在Eclipse的手机文件浏览器(以DDMS透视图)可见。

Maybe there is some Windows caching behind in order not to continuously poll the directory listing. Try hitting F5 in Explorer to see if file comes up. In any case, file should be visible in Eclipse's phone File Explorer (in DDMS Perspective).

这篇关于Android的SD卡创建的文件不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆