github.com/coming-chat/gomobile@v0.0.0-20220601074111-56995f7d7aba/bind/java/context_android.go (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 package java // import "golang.org/x/mobile/bind/java" 6 7 // #cgo LDFLAGS: -llog 8 // 9 //#include <jni.h> 10 import "C" 11 12 import ( 13 "unsafe" 14 15 "golang.org/x/mobile/internal/mobileinit" 16 ) 17 18 //export setContext 19 func setContext(vm *C.JavaVM, ctx C.jobject) { 20 mobileinit.SetCurrentContext(unsafe.Pointer(vm), uintptr(ctx)) 21 }