From 5b805bb54e69a11ea57dc2b71590639dd1539169 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Wed, 9 Nov 2022 11:45:09 +0800 Subject: [PATCH] =?UTF-8?q?3.8.9=E7=BC=96=E8=AF=91=E5=99=A8=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=20onAppTrimMemory=20=E5=8A=9F=E8=83=BD=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 11 +++++++++-- .../uni-memorywarning/utssdk/app-android/index.uts | 1 - 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index c270d7f..28fdc87 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -89,10 +89,17 @@ }, testonMemoryWarning() { uni.onMemoryWarning(this.onMemoryWarning) + uni.showToast({ + icon:'none', + title:'已监听,注意控制台输出' + }) }, testoffMemoryWarning(){ - // uni.offMemoryWarning(this.onMemoryWarning) - uni.offMemoryWarning() + uni.offMemoryWarning(this.onMemoryWarning) + uni.showToast({ + icon:'none', + title:'监听已移除' + }) }, testScreenShotListen() { var that = this; diff --git a/uni_modules/uni-memorywarning/utssdk/app-android/index.uts b/uni_modules/uni-memorywarning/utssdk/app-android/index.uts index a74c48d..6e1d240 100644 --- a/uni_modules/uni-memorywarning/utssdk/app-android/index.uts +++ b/uni_modules/uni-memorywarning/utssdk/app-android/index.uts @@ -4,7 +4,6 @@ let listeners: UTSCallback[] = [] const onAppTrimMemoryListener = (res: number) => { listeners.forEach(listener => { - console.log("listener " + listener); listener(res) }) } -- GitLab