diff --git a/app/src/main/java/com/simplemobiletools/calendar/activities/EventActivity.java b/app/src/main/java/com/simplemobiletools/calendar/activities/EventActivity.java index 351502115..c2d6b4d8e 100644 --- a/app/src/main/java/com/simplemobiletools/calendar/activities/EventActivity.java +++ b/app/src/main/java/com/simplemobiletools/calendar/activities/EventActivity.java @@ -381,7 +381,6 @@ public class EventActivity extends SimpleActivity implements DBHelper.DBOperatio public void eventUpdated(Event event) { Utils.scheduleNotification(getApplicationContext(), event); Utils.showToast(getApplicationContext(), R.string.event_updated); - setResult(RESULT_OK); finish(); } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/DayFragment.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/DayFragment.kt index 50eaa5d78..658b47a8d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/DayFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/DayFragment.kt @@ -59,6 +59,10 @@ class DayFragment : Fragment(), DBHelper.DBOperationsListener, AdapterView.OnIte override fun onViewCreated(view: View?, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) mToBeDeleted = ArrayList() + } + + override fun onResume() { + super.onResume() checkEvents() } @@ -134,16 +138,12 @@ class DayFragment : Fragment(), DBHelper.DBOperationsListener, AdapterView.OnIte } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { - if (requestCode == EDIT_EVENT && resultCode == Activity.RESULT_OK) { - if (data == null) { - checkEvents() - } else { - val deletedId = data.getIntExtra(DELETED_ID, -1) - if (deletedId != -1) { - mToBeDeleted.clear() - mToBeDeleted.add(deletedId) - notifyDeletion() - } + if (requestCode == EDIT_EVENT && resultCode == Activity.RESULT_OK && data != null) { + val deletedId = data.getIntExtra(DELETED_ID, -1) + if (deletedId != -1) { + mToBeDeleted.clear() + mToBeDeleted.add(deletedId) + notifyDeletion() } } }