Skip to content

Instantly share code, notes, and snippets.

@raghunandankavi2010
Created October 13, 2020 16:03
Show Gist options
  • Save raghunandankavi2010/6eac851b3c508266eae3b454de30b451 to your computer and use it in GitHub Desktop.
Save raghunandankavi2010/6eac851b3c508266eae3b454de30b451 to your computer and use it in GitHub Desktop.
launch activity
inline fun <refied T: Any> Context.openActivity(noinline init: Intent.()-> Unit = {}){
val intent == newIntent<T>(this)
intent.init()
startActivity(intent)
}
inline <refied T: Any> fun newIntent(context: Context): Int{
Intent(context.T::class.kava)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment