context_android.go 430 B

123456789101112131415161718192021
  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. package java
  5. // #cgo LDFLAGS: -llog
  6. //
  7. //#include <jni.h>
  8. import "C"
  9. import (
  10. "unsafe"
  11. "golang.org/x/mobile/internal/mobileinit"
  12. )
  13. //export setContext
  14. func setContext(vm *C.JavaVM, ctx C.jobject) {
  15. mobileinit.SetCurrentContext(unsafe.Pointer(vm), uintptr(ctx))
  16. }