diff --git a/bind/java/doc.go b/bind/java/doc.go index 0002208..77c4c26 100644 --- a/bind/java/doc.go +++ b/bind/java/doc.go @@ -1,6 +1,16 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + // Package java implements the Java language bindings. // // See the design document (http://golang.org/s/gobind). // // Currently, this works only for android. package java + +// Init initializes communication with Java. +// Typically called from the Start callback in app.Run. +func Init() { + initSeq() +} diff --git a/bind/java/noimpl.go b/bind/java/noimpl.go new file mode 100644 index 0000000..c123645 --- /dev/null +++ b/bind/java/noimpl.go @@ -0,0 +1,9 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !android + +package java + +func initSeq() {} diff --git a/bind/java/seq_android.go b/bind/java/seq_android.go index 4af5e13..62f4f2d 100644 --- a/bind/java/seq_android.go +++ b/bind/java/seq_android.go @@ -78,9 +78,7 @@ func init() { res.out = make(map[int32]*seq.Buffer) } -// Init initializes communication with Java. -// Typically called from the Start callback in app.Run. -func Init() { +func initSeq() { vm := app.State.(interface { JavaVM() unsafe.Pointer }).JavaVM()