Android写入文件电脑看不到

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

 根目录路径:

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

 

MediaScannerConnection.scanFile(this, new String[]{newfile.getAbsolutePath()}, null, null);
说明:
newfile是写入的路径
posted @   沉迷编程的程序员  阅读(460)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示