startActivityIfNeeded

fun startActivityIfNeeded(activity: Activity, requestCode: Int): Boolean

A special variation to launch an activity only if a new activity instance is needed to handle the given Intent.

Parameters

activity

An activity.

requestCode

If >= 0, this code will be returned in onActivityResult() when the activity exits.