Opposite of “ANativeWindow\_fromSurface”


With the method

ANativeWindow* ANativeWindow_fromSurface(JNIEnv* env, jobject surface);

I can get ANativeWindow object.

Can I get the opposite? [jobject of surface from ANativeWindow]

(I want to use this surface in java…)


Since Android API level 26, there is

jobject ANativeWindow_toSurface(JNIEnv *env, ANativeWindow *window)

Return a Java Surface object derived from the ANativeWindow, for interacting with it through Java code.


Answered By – Neat

Leave a Comment