Starting a new Activity
suggest changecontext and Activity are stand-ins. Activity is the platform base class, so these intents do not name a concrete screen.
fun startNewActivity(){
val intent: Intent = Intent(context, Activity::class.java)
startActivity(intent)
}
You can add extras to the intent just like in Java. KEY_NAME and KEY_VALUE are stand-ins.
fun startNewActivityWithIntents(){
val intent: Intent = Intent(context, Activity::class.java)
intent.putExtra(KEY_NAME, KEY_VALUE)
startActivity(intent)
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents