Skip to content

Instantly share code, notes, and snippets.

@the-dagger
Created December 30, 2017 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save the-dagger/30d4338fa82bf0a058ed059412e29d8d to your computer and use it in GitHub Desktop.
Save the-dagger/30d4338fa82bf0a058ed059412e29d8d to your computer and use it in GitHub Desktop.
fun startIntent(s : Student){
val intent = Intent(this,HomeActivity::class.java)
with(intent){
putExtra(NAME,name) // No need to use intent object anymore
putExtra(SUBJECT,subject)
putExtra(IMAGE,image)
}
startActivity(intent)
}
fun receiveIntent(i : Intent){
with(i){
val name = getStringExtra(NAME)
val subject = getStringExtra(SUBJECT)
val image = getStringExtra(IMAGE)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment