diff --git a/uni_modules/uni-usercapturescreen/utssdk/app-android/index.uts b/uni_modules/uni-usercapturescreen/utssdk/app-android/index.uts index fd92a79a318574235fcc6189a0e1abf75e539016..99cf531e58733d6ae0c68ace8dc08e7c0d99b530 100644 --- a/uni_modules/uni-usercapturescreen/utssdk/app-android/index.uts +++ b/uni_modules/uni-usercapturescreen/utssdk/app-android/index.uts @@ -85,6 +85,14 @@ export const onUserCaptureScreen : OnUserCaptureScreen = function (callback : Us observer?.stopWatching(); observer = new ScreenFileObserver(directory_screenshot); observer?.startWatching(); + + + UTSAndroid.onAppActivityDestroy(function(){ + observer?.stopWatching() + observer = null + }) + + } /**