mirror of
https://github.com/netbirdio/gomobile-tvos-fork.git
synced 2026-05-22 18:43:29 -07:00
bind/java: find jbytearray class info using jbytearray object.
The previous way (JNIEnv's FindClass with "[B") does not work in Android-L for some reason. Change-Id: I5cccb7bbf651df981a923ecade863302521d5c5c Reviewed-on: https://go-review.googlesource.com/9783 Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
committed by
Hyang-Ah Hana Kim
parent
ddfab7d990
commit
910c3fc64e
@@ -215,7 +215,12 @@ void init_seq(void *javavm, void *classfinder) {
|
||||
receive_handle_id = find_field(env, "go/Seq$Receive", "handle", "I");
|
||||
receive_code_id = find_field(env, "go/Seq$Receive", "code", "I");
|
||||
|
||||
jbytearray_clazz = find_class(env, "[B");
|
||||
// Find jbyteArray class info by instantiating a jbyteArray and getting
|
||||
// its class info, because finding the jbyteArray class ("[B") using
|
||||
// find_class_fn or JNIEnv's FindClass does not work on android-L.
|
||||
jbyteArray a = (*env)->NewByteArray(env, 0);
|
||||
jclass clazz = (*env)->GetObjectClass(env, a);
|
||||
jbytearray_clazz = (*env)->NewGlobalRef(env, clazz);
|
||||
|
||||
LOG_INFO("loaded go/Seq");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user