Android写入文件电脑看不到

原因是因为没有刷新,写入文件后执行以下代码即可。

 根目录路径:

 File newfile = new File(Environment.getExternalStorageDirectory() + "/1.txt");

 

MediaScannerConnection.scanFile(this, new String[]{newfile.getAbsolutePath()}, null, null);
说明:
newfile是写入的路径
posted @ 2019-02-19 05:36  科技改变未来☆  阅读(456)  评论(0编辑  收藏  举报