diff --git a/uni_modules/uni-usercapturescreen/utssdk/app-android/index.uts b/uni_modules/uni-usercapturescreen/utssdk/app-android/index.uts index 0774e5de66caa76e3f0196addd3794681d224e99..a555dad9e9a51293fd7b2343f4203d95584e7b18 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 + }) + + } /**