Activity not found

Report a typo

Suppose we have an Android device that doesn't have the apps that can respond to the intent below, change the code so that it handles that situation using the try...catch block.

If the activity is not found, call the function handleActivityNotFound().

Write a program in Kotlin
fun openJetbrainsAcademy() {
val url = "https://www.jetbrains.com/academy/"
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))

// Change the code below
startActivity(intent)
}
___

Create a free account to access the full topic