Skip to content

Instantly share code, notes, and snippets.

@abohomol
Created October 25, 2018 12:09
Show Gist options
  • Save abohomol/c0492cdde48ea0ac830cd47af261630f to your computer and use it in GitHub Desktop.
Save abohomol/c0492cdde48ea0ac830cd47af261630f to your computer and use it in GitHub Desktop.
class SomeActivity : Activity() {
...
companion object {
fun newIntent(context: Context): Intent {
return Intent(context, SomeActivity::class.java)
}
}
}
/* From Java you can call this function this way: */
Intent intent = SomeActivity.Companion.newIntent(context)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment