github.com/adwpc/xmobile@v0.0.0-20231212131043-3f9720cf0e99/bind/java/context_android.c (about)

     1  // Copyright 2016 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  #include <jni.h>
     6  #include "seq_android.h"
     7  #include "_cgo_export.h"
     8  
     9  JNIEXPORT void JNICALL
    10  Java_go_Seq_setContext(JNIEnv* env, jclass clazz, jobject ctx) {
    11  	JavaVM* vm;
    12  	if ((*env)->GetJavaVM(env, &vm) != 0) {
    13  		LOG_FATAL("failed to get JavaVM");
    14  	}
    15  	setContext(vm, (*env)->NewGlobalRef(env, ctx));
    16  }