diff --git a/uni_modules/uts-nativepage/utssdk/app-android/index.uts b/uni_modules/uts-nativepage/utssdk/app-android/index.uts index 386d6e5d67728e60b60cf15f0f33c79f7e2b2f09..24c4a203c62d47d471048c22d57e6ead998b3fe6 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