1 Commits

Author SHA1 Message Date
terrakok 1701bc4f36 Fixed launching Activity via no concrete Intent. 2020-11-18 22:02:18 +03:00
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ ext {
bintrayName = 'cicerone-kotlin'
publishedGroupId = 'com.github.terrakok'
artifact = 'cicerone'
libraryVersion = '6.4'
libraryVersion = '6.5'
gitUrl = 'https://github.com/terrakok/Cicerone'
allLicenses = ['MIT']
}
@@ -1,5 +1,6 @@
package com.github.terrakok.cicerone.androidx
import android.content.ActivityNotFoundException
import android.content.Intent
import androidx.fragment.app.*
import com.github.terrakok.cicerone.*
@@ -171,9 +172,9 @@ open class AppNavigator @JvmOverloads constructor(
private fun checkAndStartActivity(screen: ActivityScreen) {
// Check if we can start activity
val activityIntent = screen.createIntent(activity)
if (activityIntent.resolveActivity(activity.packageManager) != null) {
try {
activity.startActivity(activityIntent, screen.startActivityOptions)
} else {
} catch (e: ActivityNotFoundException) {
unexistingActivity(screen, activityIntent)
}
}