Last active
March 13, 2019 13:01
-
-
Save PiotrPrus/0d6e8858256fdbea93d111ab1f2f065d to your computer and use it in GitHub Desktop.
Companion object of Parameterized Activity
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
class ParameterizedActivity : AppCompatActivity() { | |
companion object { | |
const val INTENT_PARAMS = "INTENT_PARAMS" | |
fun start(context: Context, params: Params) { | |
val intent = Intent(context, ParameterizedActivity::class.java) | |
intent.putExtra(INTENT_PARAMS, params) | |
context.startActivity(intent) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment