方法一:

Uri updateUri = Uri.fromFile(file);
Intent updateIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, updateUri);
sendBroadcast(updateIntent);

方法二:

ContentValues localContentValues = new ContentValues();

localContentValues.put("_data", imageFile.toString());

localContentValues.put("description", "save image ---");

localContentValues.put("mime_type", "image/jpeg");

ContentResolver localContentResolver = getContentResolver();

Uri localUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;

localContentResolver.insert(localUri, localContentValues);

 

参考:http://blog.sina.com.cn/s/blog_5689926f0100udgo.html

 

相关文章:

  • 2022-12-23
  • 2021-11-24
  • 2022-01-07
  • 2022-02-06
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2021-12-02
猜你喜欢
  • 2021-10-08
  • 2021-08-14
  • 2022-12-23
  • 2021-06-27
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案