Skip to content

Commit 1701bc4

Browse files
committed
Fixed launching Activity via no concrete Intent.
1 parent 9c9c56b commit 1701bc4

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

library/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ext {
1818
bintrayName = 'cicerone-kotlin'
1919
publishedGroupId = 'com.github.terrakok'
2020
artifact = 'cicerone'
21-
libraryVersion = '6.4'
21+
libraryVersion = '6.5'
2222
gitUrl = 'https://github.com/terrakok/Cicerone'
2323
allLicenses = ['MIT']
2424
}

library/src/main/kotlin/com/github/terrakok/cicerone/androidx/AppNavigator.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.github.terrakok.cicerone.androidx
22

3+
import android.content.ActivityNotFoundException
34
import android.content.Intent
45
import androidx.fragment.app.*
56
import com.github.terrakok.cicerone.*
@@ -171,9 +172,9 @@ open class AppNavigator @JvmOverloads constructor(
171172
private fun checkAndStartActivity(screen: ActivityScreen) {
172173
// Check if we can start activity
173174
val activityIntent = screen.createIntent(activity)
174-
if (activityIntent.resolveActivity(activity.packageManager) != null) {
175+
try {
175176
activity.startActivity(activityIntent, screen.startActivityOptions)
176-
} else {
177+
} catch (e: ActivityNotFoundException) {
177178
unexistingActivity(screen, activityIntent)
178179
}
179180
}

0 commit comments

Comments
 (0)