Java Question [Solved] PreviewCallback

Johan Schoeman

Expert
Licensed User
Longtime User
I have this code in a wrapper but the PreviewCallback does not get fired:

B4X:
        PreviewCallback mPreviewCallback = new PreviewCallback() {
           
            @Override
            public void onPreviewFrame(byte[] data, Camera camera) {
            BA.Log("In onPreviewFrame");       
                processImage(data);

            }
        };

I do have
import android.hardware.Camera.PreviewCallback;
in the wrapper. No compiling error - it just won't fire.

Some pointers will be much appreciated.
 

Johan Schoeman

Expert
Licensed User
Longtime User
and you added the
mPreviewCallback
to the wrapped object in some way?
B4X:
myobject.addpreviewcallback(mPreviewCallback);
?
The callback should come from android.harware.Camera...? I imported Andoid.hardware.Camera.PreviewCallback. Should that not then raise the callback?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…