Skip to content

Instantly share code, notes, and snippets.

@ahndwon
Created November 19, 2020 00:37
Show Gist options
  • Save ahndwon/b7a8df6d362ba486144dd58dcf153864 to your computer and use it in GitHub Desktop.
Save ahndwon/b7a8df6d362ba486144dd58dcf153864 to your computer and use it in GitHub Desktop.
inline fun <reified T : AppCompatActivity> Context.startActivity(
vararg extras: Pair<String, Any?>,
intentAction: Intent.() -> Unit = {}
) {
startActivity(Intent(this, T::class.java).apply {
putExtras(bundleOf(*extras))
intentAction()
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment