Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

not finishing activity when passing picture of byte array taken by camera

Tags:

android

i am using a main activity which is calling a cameraActivity and using picture taken by camera. i am finish camera activity on pictureTaken and passing byte array to parent activity

  protected PictureCallback jpegCallback=new PictureCallback() {
    public void onPictureTaken(byte[] data, Camera camera) {

               //Finishing Camera activity              
           Bundle bundle=new Bundle();
       bundle.putByteArray("imageToPreview", data);
       mPreview.imageBundle=bundle;
               Intent it=new Intent;
               it.putExtras(bundle);
               CameraActivity.this.setResult(Activity.RESULT_OK,it);
       CameraActivity.this.finish();

        } 

      }
    };

so passing image byte array creating problem and result in not finish of activity.

if i pass simply

CameraActivity.this.setResult(Activity.RESULT_OK);
CameraActivity.this.finish();

it working properly plz help i have to use this image in parent activity

like image 309
Sunil Pandey Avatar asked Oct 12 '22 15:10

Sunil Pandey


1 Answers

i got the solution of my problem actually we should not pass large amount of data through intent as mentioned here

like image 172
Sunil Pandey Avatar answered Nov 15 '22 11:11

Sunil Pandey