Are you thinking that the HTC Incredible does NOT scan the SD-card when one is re-inserted (re-mounted)? That would suck.
On May 9, 5:48 am, Martiño <martino.figue...@gmail.com> wrote: > Hello, > > I'm making an alternative camera App. As you might expect my App > involves taking pictures and saving them to the sdcard. > > On most phones (and the Emulator) everything works fine, pictures > appear in the built-in Gallery App straight away. > > However on the HTC incredible images only appear when the user > restarts the device. (I'm talking about an HTC Incredible phone with > an sdcard, I know some of them shipped with internal storage only, but > this is not the issue I'm talking about) > > The code I'm currently trying goes like this: > > public static boolean savePicture(Bitmap bitmap, int quality, > String label, Context context) { > > ContentResolver resolver = context.getContentResolver(); > > // Save the name and description of an image in a > ContentValues map. > ContentValues values = new ContentValues(3); > > values.put(MediaStore.MediaColumns.MIME_TYPE, "image/jpeg"); > values.put(MediaStore.MediaColumns.TITLE, label + ".jpg"); > > // Add a new record without the bitmap > Uri uri = resolver.insert(Media.EXTERNAL_CONTENT_URI, values); > > // Get a handle to the file for that record, and save the > data into > it. > try { > OutputStream outStream = > resolver.openOutputStream(uri); > bitmap.compress(Bitmap.CompressFormat.JPEG, quality, > outStream); > outStream.close(); > context.sendBroadcast(new > Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri)); > } catch (Exception e) { > return false; > } > return true; > } > > I've also tried MediaScannerConnection.scanFIle() with no luck. > > I wonder is the problem is due to the HTC incredible being originally > designed to operate with internal storage only, maybe the Gallery App > has issues with media stored on the sdcard. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group > athttp://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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en