Monday, 12 August 2013

CWAC Camera - Overriding saveImage()

CWAC Camera - Overriding saveImage()

I'm trying to use my own custom implementation of CWAC Camera. I am trying
to override the saveImage function on my own extension of the
SimpleCameraHost. This is my code:
You are welcome to override saveImage(byte[]) and do something else with
the byte[], such as send it over the Internet. saveImage(byte[]) is called
on a background thread, so you do not have to do your own asynchronous
work.
@Override
public void saveImage(byte[] byteArray) {
Intent myIntent = new Intent();
retData.putExtra("data", byteArray);
getActivity().setResult(Activity.RESULT_OK, myIntent);
getActivity().finish();
}
I'm testing this on a samsung galaxy S3, and it works perfectly, but when
I try to use the front facing camera, my application freezes up and
crashes. I'm not doing anything onActivityResult, so it is originating
from the CameraFragment. Don't know what could be wrong because the
documentation says that it has been tested with an S3.

No comments:

Post a Comment