From 34014fdda774a42f0d9981b6ae004d323535734a Mon Sep 17 00:00:00 2001 From: duqingquan Date: Fri, 17 Mar 2023 16:09:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=88=AA=E5=B1=8F=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=20=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uni-usercapturescreen/utssdk/app-android/index.uts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/uni_modules/uni-usercapturescreen/utssdk/app-android/index.uts b/uni_modules/uni-usercapturescreen/utssdk/app-android/index.uts index 0774e5d..a555dad 100644 --- a/uni_modules/uni-usercapturescreen/utssdk/app-android/index.uts +++ b/uni_modules/uni-usercapturescreen/utssdk/app-android/index.uts @@ -84,6 +84,14 @@ export const onUserCaptureScreen : OnUserCaptureScreen = function (callback : Us observer?.stopWatching(); observer = new ScreenFileObserver(directory_screenshot); observer?.startWatching(); + + + UTSAndroid.onAppActivityDestroy(function(){ + observer?.stopWatching() + observer = null + }) + + } /** -- GitLab