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) {
|
||||
Utils.scheduleNotification(getApplicationContext(), event);
|
||||
Utils.showToast(getApplicationContext(), R.string.event_updated);
|
||||
setResult(RESULT_OK);
|
||||
finish();
|
||||
}
|
||||
|
||||
|
|
|
@ -59,6 +59,10 @@ class DayFragment : Fragment(), DBHelper.DBOperationsListener, AdapterView.OnIte
|
|||
override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
mToBeDeleted = ArrayList<Int>()
|
||||
}
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue