update at 2022-02-25 14:57:47 by ehlxr

master
ehlxr 2022-02-25 14:57:47 +08:00
parent d4fa79c52c
commit 2758c25d35
1 changed files with 3 additions and 2 deletions

View File

@ -82,7 +82,7 @@ pub extern "system" fn Java_me_ehlxr_HelloWorld_getFiled(
); );
println!("get no field: {}", no); println!("get no field: {}", no);
let _out_str = if let JValue::Object(result) = env let out_str = if let JValue::Object(result) = env
.call_method(input, "getName", "()Ljava/lang/String;", &[]) .call_method(input, "getName", "()Ljava/lang/String;", &[])
.unwrap() .unwrap()
{ {
@ -92,6 +92,7 @@ pub extern "system" fn Java_me_ehlxr_HelloWorld_getFiled(
} else { } else {
"".to_string() "".to_string()
}; };
println!("Hello {}! from Rust..", out_str);
let jlist = unwrap( let jlist = unwrap(
&env, &env,
@ -130,7 +131,7 @@ pub extern "system" fn Java_me_ehlxr_HelloWorld_getFiled(
jlist.into_inner() jlist.into_inner()
// let output = env // let output = env
// .new_string(format!("Hello {}! from Rust..", _out_str)) // .new_string(format!("Hello {}! from Rust..", out_str))
// .expect("Couldn't create java string!"); // .expect("Couldn't create java string!");
// output.into_inner() // output.into_inner()
} }