mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-17 04:10:45 +01:00
recheck daily events more frequently, at every resume
This commit is contained in:
parent
7fb26ea71c
commit
8c4b4a6c6d
@ -381,7 +381,6 @@ public class EventActivity extends SimpleActivity implements DBHelper.DBOperatio
|
|||||||
public void eventUpdated(Event event) {
|
public void eventUpdated(Event event) {
|
||||||
Utils.scheduleNotification(getApplicationContext(), event);
|
Utils.scheduleNotification(getApplicationContext(), event);
|
||||||
Utils.showToast(getApplicationContext(), R.string.event_updated);
|
Utils.showToast(getApplicationContext(), R.string.event_updated);
|
||||||
setResult(RESULT_OK);
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,6 +59,10 @@ class DayFragment : Fragment(), DBHelper.DBOperationsListener, AdapterView.OnIte
|
|||||||
override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
mToBeDeleted = ArrayList<Int>()
|
mToBeDeleted = ArrayList<Int>()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
checkEvents()
|
checkEvents()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,16 +138,12 @@ class DayFragment : Fragment(), DBHelper.DBOperationsListener, AdapterView.OnIte
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
if (requestCode == EDIT_EVENT && resultCode == Activity.RESULT_OK) {
|
if (requestCode == EDIT_EVENT && resultCode == Activity.RESULT_OK && data != null) {
|
||||||
if (data == null) {
|
val deletedId = data.getIntExtra(DELETED_ID, -1)
|
||||||
checkEvents()
|
if (deletedId != -1) {
|
||||||
} else {
|
mToBeDeleted.clear()
|
||||||
val deletedId = data.getIntExtra(DELETED_ID, -1)
|
mToBeDeleted.add(deletedId)
|
||||||
if (deletedId != -1) {
|
notifyDeletion()
|
||||||
mToBeDeleted.clear()
|
|
||||||
mToBeDeleted.add(deletedId)
|
|
||||||
notifyDeletion()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user