Well I still don't understand why it wasn't working, but I found a way
to get it working.
I replaced this:
MediaScannerConnection.scanFile(this, new String[] {
photoFile.getAbsolutePath() },
new String[] { "image/jpeg" }, null);
With this:
MediaStore.Images.Media.insertImage(getContentResolver(),
photoFile.getAbsolutePath(), photoFile.getName(),
photoFile.getName());
And now it works...
On Wed, Jan 19, 2011 at 12:56 PM, mjmeyer <[email protected]> wrote:
> You may have to try saving the pics to a dir under SD root.
>
> In an augmented reality game of mine, I save pics to a dir my app
> creates on SD card and then use MediaScanner to cause them to show up
> in Gallery. Works fine 1.6 -> 2.2.
>
> I did notice that before adding the MediaScanner stuff, the pics
> wouldnt show up in the Gallery app until after the SD card was
> unmounted and remounted (which causes a full scan).
>
> So, if it's true that your pics dont show up after remounting the SD
> card, then I would suspect that perhaps the root of SD is exempt from
> media scan?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en