From 72944093da98edb1992f18a88d9bb59562f0b1cd Mon Sep 17 00:00:00 2001 From: duqingquan Date: Tue, 12 Mar 2024 11:09:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85string.match=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utssdk/app-android/index.uts | 22 +++++++++++++++++++ .../app-android/res/layout/demo_activity.xml | 1 + uni_modules/uts-tests/utssdk/String.uts | 7 ++++++ 3 files changed, 30 insertions(+) diff --git a/uni_modules/uts-nativepage/utssdk/app-android/index.uts b/uni_modules/uts-nativepage/utssdk/app-android/index.uts index 386d6e5..24c4a20 100644 --- a/uni_modules/uts-nativepage/utssdk/app-android/index.uts +++ b/uni_modules/uts-nativepage/utssdk/app-android/index.uts @@ -200,6 +200,25 @@ class RootActivityStartListener extends OnClickListener{ } } +class RootPageStartListener extends OnClickListener{ + + host:Activity + + constructor(activity:Activity){ + super() + this.host = activity + } + + override onClick(v?: View):void{ + let packageName = UTSAndroid.getAppContext()!.getPackageName() + console.log("packageName",packageName) + console.log("host",this.host) + let intent = host.getPackageManager().getLaunchIntentForPackage(packageName) + intent?.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + host.startActivity(intent) + } +} + /** * 自定义异步线程 */ @@ -281,6 +300,9 @@ class DemoActivity extends Activity{ let btn_start_root_activity = this.findViewById