当保存华硕变压器SD卡上的文件在Windows资源管理器中不可见 [英] Files not visible in windows explorer when saved on ASUS transformer SD Card

查看:186
本文介绍了当保存华硕变压器SD卡上的文件在Windows资源管理器中不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我运行华硕变压器下面code,那么'TESTFILE.TXT在SD卡目录的顶层创建预期。

If I run the following code on an ASUS Transformer then 'testfile.txt' is created in the top level of the 'sd card' directory as expected.

private void testWriteFile () throws IOException
{
    File sdCard = Environment.getExternalStorageDirectory();
    File file = new File(sdCard, "testfile.txt");

    FileOutputStream myOutput = new FileOutputStream(file);
    byte buffer[] = {'0','1','2','3','4','5','6','7','8','9'};      

    myOutput.write(buffer,0,buffer.length);

    myOutput.flush();
    myOutput.close();
}

我可以使用文件管理器应用程序查看华硕Transformer中的文件。我可以通过亚行外壳命令来查看从Windows DOS中的文件和它的权限似乎正确设置。但是,如果我从Windows资源管理器查看该目录,'TESTFILE.TXT'是不存在的。我已经设置显示隐藏文件和系统文件的选项,但没有运气。

I can view the file on the ASUS Transformer using a File Manager app. I can see the file from a Windows dos box via the 'adb shell' command and its permissions appear to be set correctly. However, if I view the directory from Windows Explorer, 'testfile.txt' is not there. I have set the options to display hidden and system files, but with no luck.

如果我用华硕的文件管理器应用更改TESTFILE.TXT的名称,然后在Windows资源管理器变成可见的,所以其他应用能够使资源管理器中的文件。

If I use the ASUS file manager app to change the name of 'testfile.txt', then it becomes visible in Windows Explorer, so other apps are able to make files visible in Explorer.

如果我运行一个刀片,中兴通讯(橙色旧金山)在同​​一code,那么我可以看到在Windows资源管理器TESTFILE.TXT,而无需更改其名称。

If I run the same code on a ZTE Blade (Orange San Francisco) then I can see 'testfile.txt' in Windows Explorer without needing to change its name.

有没有别的东西,我需要做的,完成这个文件,使之成为可见的?

Is there something else I need to do to finalize this file so that it becomes visible?

有一个类似的问题在这里报道,<一个href=\"http://stackoverflow.com/questions/7429087/cant-see-a-file-in-windows-written-by-an-android-app-on-sd-card-unless-i-force\">Can't看到SD卡上的Andr​​oid应用程序编写的Windows中的文件,除非I&QUOT;强制关闭&QUOT;此应用,但迫使我的情况下,关闭不使文件可见。

A similar problem is reported here, Can't see a file in Windows written by an android app on sd-card unless I "Force Close" the app, but forcing a close in my case does not make the file visible.

推荐答案

我下面的指令解决了这个:

I have solved this with the following instruction:

    MediaScannerConnection.scanFile
             (this, new String[] {file.toString()}, null, null);

我不知道为什么,这是必需的华硕没有为中兴刀片。然而,在他们连接到PC的方式的差异,我怀疑这就是原因。

I am not sure why this is required for the Asus and not for the ZTE Blade. However, there is a difference in the way that they connect to my PC and I suspect this is the reason.

中兴刀片显示为一个USB大容量存储设备,并分配一个驱动器号。华硕显示为便携式媒体播放器(MTP),并没有分配驱动器号。

The ZTE Blade appears as a USB mass storage device and is assigned a drive letter. The Asus appears as a portable media player (MTP) and is not assigned a drive letter.

这篇关于当保存华硕变压器SD卡上的文件在Windows资源管理器中不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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