fix #706, open specific event details from List view when clicked directly

This commit is contained in:
tibbi
2018-12-03 16:58:59 +01:00
parent b156fae9ff
commit dbdd1b5b5a
2 changed files with 4 additions and 4 deletions

View File

@@ -273,11 +273,11 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
return true return true
} }
val eventIdToOpen = intent.getLongExtra(EVENT_ID, 0) val eventIdToOpen = intent.getLongExtra(EVENT_ID, 0L)
val eventOccurrenceToOpen = intent.getIntExtra(EVENT_OCCURRENCE_TS, 0) val eventOccurrenceToOpen = intent.getLongExtra(EVENT_OCCURRENCE_TS, 0L)
intent.removeExtra(EVENT_ID) intent.removeExtra(EVENT_ID)
intent.removeExtra(EVENT_OCCURRENCE_TS) intent.removeExtra(EVENT_OCCURRENCE_TS)
if (eventIdToOpen != 0L && eventOccurrenceToOpen != 0) { if (eventIdToOpen != 0L && eventOccurrenceToOpen != 0L) {
Intent(this, EventActivity::class.java).apply { Intent(this, EventActivity::class.java).apply {
putExtra(EVENT_ID, eventIdToOpen) putExtra(EVENT_ID, eventIdToOpen)
putExtra(EVENT_OCCURRENCE_TS, eventOccurrenceToOpen) putExtra(EVENT_OCCURRENCE_TS, eventOccurrenceToOpen)

View File

@@ -14,7 +14,7 @@ class SplashActivity : BaseSplashActivity() {
} }
intent.extras?.containsKey(EVENT_ID) == true -> Intent(this, MainActivity::class.java).apply { intent.extras?.containsKey(EVENT_ID) == true -> Intent(this, MainActivity::class.java).apply {
putExtra(EVENT_ID, intent.getLongExtra(EVENT_ID, 0L)) putExtra(EVENT_ID, intent.getLongExtra(EVENT_ID, 0L))
putExtra(EVENT_OCCURRENCE_TS, intent.getIntExtra(EVENT_OCCURRENCE_TS, 0)) putExtra(EVENT_OCCURRENCE_TS, intent.getLongExtra(EVENT_OCCURRENCE_TS, 0L))
startActivity(this) startActivity(this)
} }
else -> startActivity(Intent(this, MainActivity::class.java)) else -> startActivity(Intent(this, MainActivity::class.java))