Skip to content

Commit

Permalink
Fixed launching Activity via no concrete Intent.
Browse files Browse the repository at this point in the history
  • Loading branch information
terrakok committed Nov 18, 2020
1 parent 9c9c56b commit 1701bc4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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']
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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.*
Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 1701bc4

Please sign in to comment.