tags:

views:

53

answers:

1

Hi -

I've got a camera application and when I take a picture the image is stored. However I cannot see it on the SD Card until I reboot the device. Any ideas why? My code is as follows. Also when I view the image as a bitmap in my activity (After restarting) the picture is flipped the wrong way around. Any ideas about that?

Camera.PictureCallback photoCallback = new Camera.PictureCallback() {
public void onPictureTaken(byte[] data, Camera camera) {
    // TODO Auto-generated method stub
    FileOutputStream fos;
    try
    {
        Bitmap bm = BitmapFactory.decodeByteArray(data, 0, data.length);
        fileUrl = MediaStore.Images.Media.insertImage(getContentResolver(),  bm, "LastTaken", "Picture");

        if(fileUrl == null)
        {
            Log.d("Still", "Image Insert Failed");
            return;
        } else
        {

             picUri = Uri.parse(fileUrl);
            sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, picUri));
        }
    }
    catch(Exception e)
    {
        Log.d("Picture", "Error Picture: ", e);
    }
    camera.startPreview();

}

};

A: 

Okay, it might be in permissions can you post your manifest file?

Fred Grott
Hi I've worked it down to the media scanner. Trying to get that to work.
steve