From f003f0fc5af8b1f603b7494b3182246a319c7b9c Mon Sep 17 00:00:00 2001 From: xuxinchao <13522809046@163.com> Date: Wed, 1 Jun 2022 11:54:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复NumberFormatException异常 --- .../hmi/ui/setting/DebugSettingView.kt | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 181287c215..6d744b0329 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -1073,13 +1073,19 @@ class DebugSettingView @JvmOverloads constructor( if (logTimeStr.isNullOrEmpty()) { logTimeStr = "10" } - val logCatchTime = logTimeStr.toInt() - if (logCatchTime > 60) { - tbLogCatch.isChecked = false - TipToast.shortTip("最长抓取时间为60分钟") - return@setOnCheckedChangeListener + try{ + val logCatchTime = logTimeStr.toInt() + if (logCatchTime > 60) { + tbLogCatch.isChecked = false + TipToast.shortTip("最长抓取时间为60分钟") + return@setOnCheckedChangeListener + } + CallerDevaToolsManager.startCatchLog(logCatchTime) + }catch (e: Exception){ + ToastUtils.showLong("输入格式错误,请重新输入正确时间数字,最长抓取时间为60分钟") + etLogCatch.setText("") } - CallerDevaToolsManager.startCatchLog(logCatchTime) + } else { CallerDevaToolsManager.stopCatchLog() }