Skip to content

Instantly share code, notes, and snippets.

@ch8n
Created April 3, 2021 19:36
Show Gist options
  • Save ch8n/eab212347cf3b2c4e78297b7ea5b734d to your computer and use it in GitHub Desktop.
Save ch8n/eab212347cf3b2c4e78297b7ea5b734d to your computer and use it in GitHub Desktop.
Intent(context, MyActivity::class.java).apply {
// scope to configure object
putExtra("data", 123)
addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
}).also { intent ->
// scope to consume the object
startActivity(this@FooActivity,intent)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment