Android写入文件电脑看不到

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

 根目录路径:

 File newfile = new File(Environment.getExternalStorageDirectory() + "/1.txt");
MediaScannerConnection.scanFile(this, new String[]{newfile.getAbsolutePath()}, null, null);
说明:
newfile是写入的路径

猜你喜欢

转载自www.cnblogs.com/codeDevotee/p/10398970.html