launch

fun Context.launch(target: Class<*>, properties: Intent.() -> Unit? = null)

Starts an activity with the specified properties for the Intent.

Author

Arnau Mora

Since

20210521

Parameters

target

The target activity's class.

properties

The setter for the properties of the Intent.


fun Context.launch(target: Class<*>, options: Bundle, properties: Intent.() -> Unit? = null)

Starts an activity with the specified properties for the Intent, and the specified options for the launching.

Author

Arnau Mora

Since

20210521

Parameters

target

The target activity's class.

options

Additional options for how the Activity should be started.

properties

The setter for the properties of the Intent.


fun Context.launch(intent: Intent, options: Bundle? = null, properties: Intent.() -> Unit? = null)

Launches an intent from the select context and adding some options and applying properties in a more Kotlin-like syntax.

Author

Arnau Mora

Since

20210521

Parameters

intent

The intent to launch.

options

Additional options for how the Intent should be launched.

properties

The setter for the properties of the Intent.


fun Intent.launch(context: Context)

Runs Context.startActivity with this.

Author

Arnau Mora

Since

20220406

Parameters

context

The context to run from.