add a check at EventActivity to not initialize things too early
This commit is contained in:
parent
086a294184
commit
9876690ae4
|
@ -33,6 +33,7 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
|
||||||
private var mEventTypeId = DBHelper.REGULAR_EVENT_TYPE_ID
|
private var mEventTypeId = DBHelper.REGULAR_EVENT_TYPE_ID
|
||||||
private var mDialogTheme = 0
|
private var mDialogTheme = 0
|
||||||
private var mEventOccurrenceTS = 0
|
private var mEventOccurrenceTS = 0
|
||||||
|
private var wasActivityInitialized = false
|
||||||
|
|
||||||
lateinit var mEventStartDateTime: DateTime
|
lateinit var mEventStartDateTime: DateTime
|
||||||
lateinit var mEventEndDateTime: DateTime
|
lateinit var mEventEndDateTime: DateTime
|
||||||
|
@ -98,6 +99,7 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
|
||||||
|
|
||||||
updateTextColors(event_scrollview)
|
updateTextColors(event_scrollview)
|
||||||
updateIconColors()
|
updateIconColors()
|
||||||
|
wasActivityInitialized = true
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupEditEvent() {
|
private fun setupEditEvent() {
|
||||||
|
@ -442,8 +444,10 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||||
menuInflater.inflate(R.menu.menu_event, menu)
|
menuInflater.inflate(R.menu.menu_event, menu)
|
||||||
menu.findItem(R.id.delete).isVisible = mDialogTheme != 0 && mEvent.id != 0
|
if (wasActivityInitialized) {
|
||||||
menu.findItem(R.id.share).isVisible = mDialogTheme != 0 && mEvent.id != 0
|
menu.findItem(R.id.delete).isVisible = mDialogTheme != 0 && mEvent.id != 0
|
||||||
|
menu.findItem(R.id.share).isVisible = mDialogTheme != 0 && mEvent.id != 0
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue