Skip to content

ActivityExtensions

BirjuVachhani edited this page Feb 13, 2019 · 1 revision

Examples

Hide Keyboard

    hideKeyboard() //see, isn't that simple?

Start Activity

    navigateTo<MainActivity>()

I know you want more. You also wanna configure your intent and pass some data also. don't you?

navigateTo<MainActivity>(){
    // Intent
    putExtra("sdk_ink",28)
}

Now, you'll say that you want to start activity for result!

// no Intent
navigateForResultTo<MainActivity>(RESULT_CODE)

// with Intent
navigateForResultTo<MainActivity>(RESULT_CODE){
    putExtra("sdk_ink",28)
}

Fragment Transaction

transact{
    // FragmentTransaction, auto committed
}

For more information, look at the ActivityExtensions.kt file.

Clone this wiki locally