library / org.akop.kotx.ext.app / android.app.Activity

Extensions for android.app.Activity

contentView

val Activity.contentView: View?

Returns the Activity's content (root) view.

hideKeyboard

fun Activity.hideKeyboard(): Unit

Hides the soft keyboard if it's visible by calling android.view.inputmethod.InputMethodManager.hideSoftInputFromWindow.

startActivityForResult

fun <T : Activity> Activity.startActivityForResult(requestCode: Int, block: Intent.() -> Unit = {}): Unit

Starts a new activity by creating a new Intent, calling block with the new instance as receiver, then passing the intent to Activity.startActivityForResult.