3

I am creating an image (some sort of copy of another gallery image) using API, and the image is not being shown in the gallery.

I know the new file is there because I can see it using adb shell, and it's placed in the same folder as the original one.

I may be wrong, but I recall reading about specifying the type of file you are creating at creation time, but I cannot find it anymore.

Thanks in advance

Felix Christy
  • 2,179
  • 1
  • 19
  • 32
richardtz
  • 4,993
  • 2
  • 27
  • 38

2 Answers2

3

After you create the file, then try manually notifying the Media Scanner about the file, as per this post.

Community
  • 1
  • 1
stuckless
  • 6,515
  • 2
  • 19
  • 27
1

After adding the file/folder just fire this broadcast.This invokes the Gallery to scan all the media files

sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,<file-path>));
Irshad Kumail
  • 1,243
  • 11
  • 10