How to solve error :“ !!! FAILED BINDER TRANSACTION !!! ” in android 4.4

后端 未结 3 829
鱼传尺愫
鱼传尺愫 2020-12-16 10:36

I used custom camera application then i open this app working fine but i open the camera view and take the picture get error Failed binder transaction in android 4.4 version

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-16 11:01

    in the code ,

    PictureCallback mPicture = new PictureCallback() {
        @Override
        public void onPictureTaken(byte[] data, Camera camera) {
    
            if (ImageType.equals("AddPicture")) {
                Intent i = new Intent(CameraActivity.this,MarketPlaceActivity.class);
                i.putExtra("data", data);// problem lies here
                startActivity(i);
            } else {
                Intent returnIntent = new Intent();
                returnIntent.putExtra("data", data);// problem lies here
                setResult(RESULT_OK, returnIntent);
                CameraActivity.this.finish();
            }
        }
    };
    

    you are trying to parse large data along with intent but as per the documentation, the Binder transaction failed because it was too large.

    Solution :

    I would suggest you to create bitmap from the received byte[] data and store the image on device.then just parse the path of that image to any other activity according to your requirement.

提交回复
热议问题