在外部存储中创建的文件没有显示出来,当设备被安装在Windows / Mac的 [英] Files created on external storage do not show up when device is mounted on Windows/Mac

查看:222
本文介绍了在外部存储中创建的文件没有显示出来,当设备被安装在Windows / Mac的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的应用程序,试图保存Android设备(的Nexus 4)在PC(Windows或Mac)以后提取一些数据到外部存储器。

I have a simple application that attempts to save some data to external storage on Android device (Nexus 4) to be later retrieved on PC (Windows or Mac).

写作成功,但是当我尝试使用Mac或通过浏览器Android文件传输Windows上的MyApp的目录只是不存在检索文件。

The writing succeeds but when i try to retrieve the file using Android File Transfer on Mac or by Explorer on Windows the MyApp directory just isn't there.

如果我使用'根浏览器应用程序在设备上,我可以看到目录和文件,所有权限看行。

If i use 'Root Explorer' app on the device itself i can see the directory and the file and all permissions look ok.

应用程序code是大致如下:

The application code is along the following lines:

        File extStorageDir = Environment.getExternalStorageDirectory();
        File path = new File(extStorageDir, "MyApp");
        File file = new File(path, "TestFile.txt");

        OutputStream os = new FileOutputStream(file);

            // ... write something

        os.close();

理念AP preciated。

Ideas appreciated.

推荐答案

看<一个href=\"http://android.stackexchange.com/questions/57913/how-do-i-refresh-rescan-the-sd-memory-in-android-4-4-kitkat\">here

使用应用程序 SD扫描仪,这似乎与Android奇巧我的Nexus 7的工作。

Use the app sd scanner, it seems to work on my Nexus 7 with android kitkat

这篇关于在外部存储中创建的文件没有显示出来,当设备被安装在Windows / Mac的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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