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
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.
I think the problem is from this: returnIntent.putExtra("data", data);
.
The transaction data is limited in intent. If you need a bitmap or a big file, you must not pass it as an extra instead just pass image path or uri and make the bitmap or file in your activity where you are displaying or using it.
see this thread. Quotation: It fails because you are trying to send an image as an intent extra and it is too large for it. You can't send image using IPC communication technics like intents or service/binder, there is a limit of 1mb/10mb depending on version of android.