更新时间:2022-12-03 21:49:07
变化imgae路径后,应通知库进行更新,所以你应该发送广播做出来。
4.4前,你可以调用这个:
After change imgae path,you should notify the gallery to update,so you should send a broadcast to make it.
Before 4.4,you can call this:
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED,Uri.parse("file://"+Environment.getExternalStorageDirectory())));
4.4后,试试这个:
After 4.4,try this:
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://" + file)));
//the file is new image's path