From b7bb6c883bf78d6036746deab34771a1a2fb201c Mon Sep 17 00:00:00 2001 From: duqingquan Date: Tue, 6 Jun 2023 15:16:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=88=AA=E5=B1=8F?= =?UTF-8?q?=E7=9B=91=E5=90=AC=20android=206.0=20=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E4=BD=BF=E7=94=A8=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uni-usercapturescreen/utssdk/app-android/index.uts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/uni_modules/uni-usercapturescreen/utssdk/app-android/index.uts b/uni_modules/uni-usercapturescreen/utssdk/app-android/index.uts index 99cf531..c5c1bd4 100644 --- a/uni_modules/uni-usercapturescreen/utssdk/app-android/index.uts +++ b/uni_modules/uni-usercapturescreen/utssdk/app-android/index.uts @@ -9,6 +9,7 @@ import Environment from "android.os.Environment"; import System from 'java.lang.System'; import WindowManager from 'android.view.WindowManager'; import { OnUserCaptureScreenCallbackResult, UserCaptureScreenCallback, OnUserCaptureScreen, OffUserCaptureScreen, SetUserCaptureScreenSuccess, SetUserCaptureScreenOptions, SetUserCaptureScreen } from "../interface.uts"; +import string from 'android.R.string'; /** @@ -34,9 +35,9 @@ class ScreenFileObserver extends FileObserver { */ private screenFile : File; - constructor(screenFile : File) { - super(screenFile); - this.screenFile = screenFile; + constructor(screenFileStr : string) { + super(screenFileStr); + this.screenFile = new File(screenFileStr); } override onEvent(event : Int, path : string | null) : void { @@ -83,7 +84,7 @@ export const onUserCaptureScreen : OnUserCaptureScreen = function (callback : Us } // 先结束监听 再开启监听 observer?.stopWatching(); - observer = new ScreenFileObserver(directory_screenshot); + observer = new ScreenFileObserver(directory_screenshot.getPath()); observer?.startWatching(); @@ -92,7 +93,6 @@ export const onUserCaptureScreen : OnUserCaptureScreen = function (callback : Us observer = null }) - } /** -- GitLab