mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-01-12 00:33:48 +01:00
handle event fetching at EventActivity on a background thread
This commit is contained in:
parent
e3decbe1b6
commit
7a6d48d9db
@ -64,9 +64,16 @@ class EventActivity : SimpleActivity() {
|
||||
val intent = intent ?: return
|
||||
mDialogTheme = getDialogTheme()
|
||||
|
||||
val eventId = intent.getLongExtra(EVENT_ID, 0)
|
||||
val event = dbHelper.getEventWithId(eventId)
|
||||
val eventId = intent.getLongExtra(EVENT_ID, 0L)
|
||||
Thread {
|
||||
val event = dbHelper.getEventWithId(eventId)
|
||||
runOnUiThread {
|
||||
gotEvent(savedInstanceState, eventId, event)
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
|
||||
private fun gotEvent(savedInstanceState: Bundle?, eventId: Long, event: Event?) {
|
||||
if (eventId != 0L && event == null) {
|
||||
finish()
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user