From 31c4f6c1d120ce3e9bda3f0fe71922882c3dfd4d Mon Sep 17 00:00:00 2001 From: jens Date: Sun, 7 Nov 2021 02:09:09 +0100 Subject: [PATCH] Fixed crash of edit wifi trigger --- .../java/com/jens/automation2/ActivityManageRule.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/jens/automation2/ActivityManageRule.java b/app/src/main/java/com/jens/automation2/ActivityManageRule.java index 22081bba..73bfd7d0 100644 --- a/app/src/main/java/com/jens/automation2/ActivityManageRule.java +++ b/app/src/main/java/com/jens/automation2/ActivityManageRule.java @@ -1113,9 +1113,7 @@ public class ActivityManageRule extends Activity { //edit TimeFrame if(resultCode == RESULT_OK && ActivityManageTriggerTimeFrame.editedTimeFrameTrigger != null) - { this.refreshTriggerList(); - } else Miscellaneous.logEvent("w", "TimeFrameEdit", "No timeframe returned. Assuming abort.", 5); } @@ -1133,8 +1131,11 @@ public class ActivityManageRule extends Activity { if(resultCode == RESULT_OK) { - newTrigger.setTriggerParameter(data.getBooleanExtra("wifiState", false)); - newTrigger.setTriggerParameter2(data.getStringExtra("wifiName")); + Trigger editedTrigger = new Trigger(); + editedTrigger.setTriggerType(Trigger_Enum.wifiConnection); + editedTrigger.setTriggerParameter(data.getBooleanExtra("wifiState", false)); + editedTrigger.setTriggerParameter2(data.getStringExtra("wifiName")); + ruleToEdit.getTriggerSet().set(editIndex, editedTrigger); this.refreshTriggerList(); } }