From 074300c061fb0bca4124e1aa8098fa45f2ad9c51 Mon Sep 17 00:00:00 2001 From: linkaipeng Date: Fri, 5 Aug 2022 19:20:29 +0800 Subject: [PATCH] fix the crash caused by the empty mListPack of NewRecordActivity fix the crash caused by the empty mListPack of NewRecordActivity --- .../java/com/alipay/hulu/activity/NewRecordActivity.java | 8 ++++++++ src/app/src/main/res/values-zh/strings.xml | 1 + src/app/src/main/res/values/strings.xml | 1 + 3 files changed, 10 insertions(+) diff --git a/src/app/src/main/java/com/alipay/hulu/activity/NewRecordActivity.java b/src/app/src/main/java/com/alipay/hulu/activity/NewRecordActivity.java index 09f7504..5431586 100644 --- a/src/app/src/main/java/com/alipay/hulu/activity/NewRecordActivity.java +++ b/src/app/src/main/java/com/alipay/hulu/activity/NewRecordActivity.java @@ -318,6 +318,11 @@ public void onClick(View v) { }); mListPack = MyApplication.getInstance().loadAppList(); + if (mListPack.isEmpty()) { + toastShort(R.string.record__app_list_empty); + finish(); + return; + } int position = 0; if (!StringUtil.isEmpty(app)) { @@ -350,6 +355,9 @@ private void initAppHeadView() { } } } + if (mListPack.isEmpty()) { + return; + } mCurrentApp = mListPack.get(position); updateHeadView(); diff --git a/src/app/src/main/res/values-zh/strings.xml b/src/app/src/main/res/values-zh/strings.xml index 0144502..301f455 100644 --- a/src/app/src/main/res/values-zh/strings.xml +++ b/src/app/src/main/res/values-zh/strings.xml @@ -126,6 +126,7 @@ 正在准备中 环境准备失败 用例名不能为空 + 已安装应用列表不能为空 录制回放 免责声明 删除此用例? diff --git a/src/app/src/main/res/values/strings.xml b/src/app/src/main/res/values/strings.xml index d81e3f1..9b6dff4 100644 --- a/src/app/src/main/res/values/strings.xml +++ b/src/app/src/main/res/values/strings.xml @@ -127,6 +127,7 @@ Preparing Environment preparing fail. Case name should not be empty. + Installed app should not be empty. Record & Replay Disclaimer Delete?