github.com/coming-chat/gomobile@v0.0.0-20220601074111-56995f7d7aba/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 }