2
votes

Please can anyone help me out with this problem?
This code below works perfectly on my HTC Desire S but not on other devices (non HTC I suspect?) which do not recognise that an image has been captured by the camera..

Also, if I take more than 4 successive pictures my app crashes - is this a known problem? maybe someone might have a custom implementation I could use instead?

I am currently using this code to fire up image capture and save to a specific location :

Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(intent, 0);

and this is my code onActivityResult :

protected void onActivityResult(int requestCode, int resultCode, Intent data) {

        Bitmap bm = null;

        switch (resultCode) {
        case 0:
            break;

        case -1:
            if (data != null) {

                try {
                    // first, open the bitmap so we can scale it down..
                    bm = Media.getBitmap(this.getContentResolver(),
                            outputFileUri);
..more code here ..

                } catch (Exception e) {
                    // log exception}
                }
            } else {
                // log image returned null data...
            }
        }

    }

Any help would be much appreciated as always!

1
Can you show the log from the logcat? - bluefalcon

1 Answers

0
votes

I think this is a well know problem with the Samsung hardware. Take a look at this blog post, which provides a hacky solution.