diff --git a/uni_modules/uts-syntaxcase/utssdk/app-android/JavaUser.java b/uni_modules/uts-syntaxcase/utssdk/app-android/JavaUser.java index 0b321dd23be31c719441786d094141e76a66ac5f..35ce1180b166a9e6ff974bdb0786a0c4a96f2c69 100644 --- a/uni_modules/uts-syntaxcase/utssdk/app-android/JavaUser.java +++ b/uni_modules/uts-syntaxcase/utssdk/app-android/JavaUser.java @@ -1,5 +1,7 @@ package uts.sdk.modules.utsSyntaxcase; +import io.dcloud.uts.console; + public class JavaUser { public String name; @@ -11,8 +13,10 @@ public class JavaUser { } public String toString() { - return "Name: " + name + ", Age: " + age; + String ret = "Name: " + name + ", Age: " + age; + console.log(ret); + return ret; } - + } diff --git a/uni_modules/uts-syntaxcase/utssdk/index.uts b/uni_modules/uts-syntaxcase/utssdk/index.uts index 19342ab21a073a5067c78487d33ee605672dc1cd..15aca889017e5aa98989cf56011562dc17ebc67f 100644 --- a/uni_modules/uts-syntaxcase/utssdk/index.uts +++ b/uni_modules/uts-syntaxcase/utssdk/index.uts @@ -267,9 +267,11 @@ export function callKotlinMethodGetInfo():String { } export function callJavaMethodGetInfo():String { - return new JavaUser("jack",12).name + return new JavaUser("jack",12).toString() } + + export function callKotlinCallbackUTS(callback: (res: string) => void) { NativeCode.kotlinCallbackUTS(function(res:string){ console.log(res)