From 9bcf48d5c7d6aa237b1b6d5c131f07a6c0af3ae6 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Fri, 17 Feb 2023 18:20:23 +0800 Subject: [PATCH] =?UTF-8?q?nativepage=20=E6=96=B0=E5=A2=9E=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E9=A1=B5=E9=9D=A2=E7=A4=BA=E4=BE=8B=20https://ask.dcl?= =?UTF-8?q?oud.net.cn/question/163268?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utssdk/app-android/index.uts | 21 +++++++++++++++++++ .../app-android/res/layout/demo_activity.xml | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/uni_modules/uts-nativepage/utssdk/app-android/index.uts b/uni_modules/uts-nativepage/utssdk/app-android/index.uts index 23ac518..43c745b 100644 --- a/uni_modules/uts-nativepage/utssdk/app-android/index.uts +++ b/uni_modules/uts-nativepage/utssdk/app-android/index.uts @@ -158,6 +158,23 @@ class StartThreadListener extends OnClickListener{ } } + +class ActivityFinishListener extends OnClickListener{ + + host:Activity + + constructor(activity:Activity){ + super() + this.host = activity + } + + override onClick(v?: View):void{ + Toast.makeText(UTSAndroid.getAppContext(),"手动关闭当前activity",Toast.LENGTH_LONG).show(); + this.host.finish() + + } +} + /** * 自定义异步线程 */ @@ -232,6 +249,10 @@ class DemoActivity extends Activity{ let btn_start_thread = findViewById