android 开发file.delete()手机上已经删除文件,但是电脑上还在。

电脑上的文件虽然没有删除,但是不能 复制,也不能粘贴。绝对不是没有刷新的问题,
如果说没有刷新或者把手机重新拔下来,插上的热心网友,就不要说了,因为文件还会存在

手机试过重启没,重启过还是这样,下载个手机助手检测一下文件,查看文件是否还在

file.delete() 看看它的返回值,如果是true,看下手机文件系统里面文件是否还存在!!!

这是android手机驱动的bug吧,一直是这样,所以不要相信你在电脑上看到的。
手机重启之后一般就对了

public static void notifySystemToScan(Context context, String filePath) {
if (TextUtils.isEmpty(filePath)) {
return;
}
Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
File file = new File(filePath);
Uri uri = Uri.fromFile(file);
intent.setData(uri);
context.sendBroadcast(intent);
}

linton1024的答案是正解,这个是微软的一个bug,强制更新下就好了