Android Newly Taken Photo from custom camera does not appear in gallery (media store)

前端 未结 3 1140
时光取名叫无心
时光取名叫无心 2021-01-24 05:40
  1. in my app, i initially load all the images from the gallery, i.e. (MediaStore.Images.Media.EXTERNAL_CONTENT_URI)

  2. user can take picture via my app, but i

3条回答
  •  一整个雨季
    2021-01-24 06:19

    Yes, you are true, you need to provide the newly created file to the MediaStore.

    MediaScannerConnection will help you.

    MediaScannerConnection provides a way for applications to pass a newly created or downloaded media file to the media scanner service. The media scanner service will read metadata from the file and add the file to the media content provider. The MediaScannerConnectionClient provides an interface for the media scanner service to return the Uri for a newly scanned file to the client of the MediaScannerConnection class.

提交回复
热议问题