Answers for "start activity for result deprecate"

0

start activity for result deprecate

var resultLauncher = registerForActivityResult(StartActivityForResult()) { result ->
    if (result.resultCode == Activity.RESULT_OK) {
        // There are no request codes
        val data: Intent? = result.data
        doSomeOperations()
    }
}

fun openSomeActivityForResult() {
    val intent = Intent(this, SomeActivity::class.java)
    resultLauncher.launch(intent)
}
Posted by: Guest on October-11-2021

Code answers related to "start activity for result deprecate"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language