fix a crash at deleting events

This commit is contained in:
tibbi 2016-09-18 21:51:17 +02:00
parent df3939f742
commit e4e9a87ae6
1 changed files with 1 additions and 8 deletions

View File

@ -171,12 +171,7 @@ class DayFragment : Fragment(), DBHelper.DBOperationsListener, AdapterView.OnIte
}
fun deleteEvents() {
val cnt = mToBeDeleted.size
val eventIDs = arrayOf<String>()
for (i in 0..cnt - 1) {
eventIDs[i] = mToBeDeleted[i].toString()
}
val eventIDs = Array(mToBeDeleted.size, { i -> (mToBeDeleted[i].toString()) })
DBHelper.newInstance(activity.applicationContext, this).deleteEvents(eventIDs)
}
@ -201,7 +196,6 @@ class DayFragment : Fragment(), DBHelper.DBOperationsListener, AdapterView.OnIte
}
override fun onCreateActionMode(mode: ActionMode, menu: Menu): Boolean {
//checkDeleteEvents()
val inflater = mode.menuInflater
inflater.inflate(R.menu.menu_day_cab, menu)
return true
@ -230,7 +224,6 @@ class DayFragment : Fragment(), DBHelper.DBOperationsListener, AdapterView.OnIte
}
override fun eventUpdated(event: Event) {
}
override fun eventsDeleted(cnt: Int) {