y30
y30

Reputation: 732

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...)

Upvotes: 0

Views: 635

Answers (1)

Neat
Neat

Reputation: 106

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.

https://developer.android.com/ndk/reference/group/native-activity#anativewindow_tosurface

Upvotes: 1

Related Questions