0

When I capture an image from the camera then load it using

                startActivityForResult(intent, RESULT_LOAD_IMAGE);

using HTC one it's working fine, but using large phones .. like S2 the app crashed ( fore close )

this is my camera function code

        btnCamera.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {

            Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
            MpClick.start();
            startActivityForResult(intent, RESULT_LOAD_IMAGE);
        }
    });

how to decode the image so it be smaller and dont fore close or scale the image ?

UPDATE ---

        btnCamera.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {

            Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
            startActivityForResult(intent, RESULT_LOAD_IMAGE);
            BitmapFactory.Options options = new BitmapFactory.Options();
            options.inSampleSize = 1;
            options.inPurgeable = true;
            options.inInputShareable = true;
        }
    });

still it doesn't work .. anyone has other solutions to decrease image size so it don't force close

John Jared
  • 790
  • 3
  • 16
  • 40

1 Answers1

0

The all problem is an issue with Galaxy S2 phones ..

so there is no solve, but the app is working great on all other phones ..

thanks all

John Jared
  • 790
  • 3
  • 16
  • 40