droid_wrap_utils

Function to_vec

Source
pub fn to_vec<'a>(
    env: &mut JNIEnv<'a>,
    arr: &JObjectArray<'_>,
) -> Vec<JObject<'a>>
Expand description

把java对象数组转换成Vec

§Arguments

  • env: java环境
  • arr: java数组

returns: Vec<JObject, Global>

§Examples

use jni::objects::JObjectArray;
use droid_wrap_utils::{to_vec, vm_attach};
vm_attach!(mut env);
unsafe {
    let arr=JObjectArray::from_raw(0 as _);
    to_vec(&mut env, &arr);
}