Skip to content

Instantly share code, notes, and snippets.

@wangerekaharun
Created July 24, 2019 12:07
Show Gist options
  • Select an option

  • Save wangerekaharun/c8c8821f2c0cac67385c851bbf32b6ed to your computer and use it in GitHub Desktop.

Select an option

Save wangerekaharun/c8c8821f2c0cac67385c851bbf32b6ed to your computer and use it in GitHub Desktop.
Getting Speakers from speaker ID
val speakersList :List<SpeakersModel> = getSpeakersInfo()
val sessionList : List<SessionsModel> = snapshots.toObjects<SessionsModel>()
sessionList.map { sessionModel ->
val sessionSpeakerIdList = sessionModel.speaker_id
sessionSpeakerIdList.forEach { speakerId ->
speakersList.forEach {speakerModel ->
if (sessionSpeakerIdList.contains(speakerModel.id)){
sessionModel.speakerList.add(speakerModel)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment