Created
November 19, 2020 00:37
-
-
Save ahndwon/b7a8df6d362ba486144dd58dcf153864 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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