I am creating an Android application where I would like to wait until PictureCallback appears before the call continues.
import android.hardware.Camera;
private Camera camera
private Bitmap picture;
camera.takePicture(null, null, new PictureCallback() {
@Override
public void onPictureTaken(byte[] data, Camera camera) {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 1;
picture = BitmapFactory.decodeByteArray(data , 0, data.length, options);
}
}
... do some other logic with picture
I would like other logic to be shared, and so I would like to avoid encoding this in the takePicture function.
Can this be done?
source
share