的Nexus 4不通过MTP显示文件不通过、文件、Nexus、MTP

由网友(走私)分享简介:我想简单地编写一个简单的XML文件到SD卡上,我发现我的Nexus 4不写入文件,但它不是通过使用Windows 7的MTP协议可见。I'm trying to simply write a simple XML file to the SD card and I noticed that my Nexus 4 do...

我想简单地编写一个简单的XML文件到SD卡上,我发现我的Nexus 4不写入文件,但它不是通过使用Windows 7的MTP协议可见。

I'm trying to simply write a simple XML file to the SD card and I noticed that my Nexus 4 does write the file, but it is not viewable via the MTP protocol using Windows 7.

code:

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    CustomerQueryRqType customerQueryRequest = new CustomerQueryRqType();
    Serializer serializer = new Persister();
    File myFile = new File(Environment.getExternalStorageDirectory() + "/customerQueryRequest.xml");

    try {
        boolean created = myFile.createNewFile();
        serializer.write(customerQueryRequest, myFile);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

我可以看到在手机本身上的文件与天文文件管理器:

I can see the file on the phone itself with Astro File Manager:

但Windows并没有看到它... ...:

but Windows doesn't see it...:

亚行外壳上的目录显示:

ls -l
drwxrwxr-x root     sdcard_rw          1970-01-16 20:51 Alarms
drwxrwxr-x root     sdcard_rw          1970-01-16 20:51 Android
drwxrwxr-x root     sdcard_rw          2012-11-21 19:30 DCIM
drwxrwxr-x root     sdcard_rw          1970-01-16 20:51 Download
drwxrwxr-x root     sdcard_rw          1970-01-16 20:51 Movies
drwxrwxr-x root     sdcard_rw          1970-01-16 20:51 Music
drwxrwxr-x root     sdcard_rw          1970-01-16 20:51 Notifications
drwxrwxr-x root     sdcard_rw          2012-11-19 12:06 Pictures
drwxrwxr-x root     sdcard_rw          1970-01-16 20:51 Podcasts
drwxrwxr-x root     sdcard_rw          2012-11-19 13:22 Ringtones
drwxrwxr-x root     sdcard_rw          2012-11-19 14:33 bluetooth
-rw-rw-r-- root     sdcard_rw       79 2012-12-05 22:26 customerQueryRequest.xml
drwxrwxr-x root     sdcard_rw          2012-11-20 02:50 data
-rw-rw-r-- root     sdcard_rw    11394 2012-11-19 13:54 eightpen_custom_gestures
drwxrwxr-x root     sdcard_rw          2012-11-19 13:17 media

这是怎么回事我的Nexus 4?为什么躲在我的东西从Windows?

What's going on with my Nexus 4? Why is it hiding my things from Windows?

推荐答案

好像是的已知的问题影响了MTP Android的USB文件访问。中期计划缓存得到过时了,直到手机重新启动。

Seems to be a known issue affecting Android USB file access over MTP. The MTP cache gets out of date until a reboot of the phone.

一个解决方法是:

清除介质存储应用程序的数据 使用 SDrescan 或在 SD扫描仪(也适用于Android 4.4系统/ 5)应用程序来强制更新 Clear the "Media Storage" app's data Use the SDrescan or the SD Scanner (also works on Android 4.4/5) app to force an update

或者只是避免使用USB可言。的问题不影响访问文件的其他方法。例如,尝试 AirDroid 传输文件。

Or just avoid using USB at all. The issue does not affect other methods of accessing the files. For example, try AirDroid to transfer files.

请注意:这并不适用于Android 5.0.2工作:清除媒体存储,并使用SD Rescanner后,文件夹会出现在Windows 7作为unopenable 4K文件。在这一点上,唯一的解决方案是再次明确介质存储并重新启动设备

Note: This doesn't work for Android 5.0.2: After clearing "Media Storage" and using an SD Rescanner, the folders appears in Windows 7 as unopenable 4K files. The only solution at that point is to clear once again Media Storage and restart the device

阅读全文

相关推荐

最新文章