Can't use TextureView in Android

Hi all,

I’m developing a RA app using JMonkeyEngine. For phone < Android L, I’m using Camera API, and for other Camera2 API.

It works fine with Camera API. With Camera2 API, you have to use TextureView instead of SurfaceView.

In my case, no camera preview is displayed on screen…

Is TextureView compatible with JMonkeyEngine ?

Here a part of my code :

public class RAActivity extends AndroidHarness {

@Override
public void onCreate(Bundle savedInstanceState) {
    mTextureView = new TextureView(mActivity);
    ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    addContentView(mTextureView, lp);
}

@Override
public void onResume() {
    super.onResume();

    if (mTextureView.isAvailable()) {
        openCamera(mTextureView.getWidth(), mTextureView.getHeight());
    } else {
        mTextureView.setSurfaceTextureListener(mSurfaceTextureListener);
    }
}

// [...]
}

Thank you for your help

Is someone can help me ?

have you tried getting the bitmap and putting it into a texture? Perhaps this method