Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaozhan committed Sep 16, 2024
2 parents 1e0c33d + 04efd01 commit 70ede97
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
package com.oztechan.ccc.android.ui.mobile.util

import android.content.ActivityNotFoundException
import android.content.Context
import android.content.Intent
import co.touchlab.kermit.Logger

@Suppress("TooGenericExceptionCaught")
fun Context.resolveAndStartIntent(intent: Intent) {
intent.resolveActivity(packageManager)?.let {
startActivity(intent)
} ?: Exception("No activity found to handle the intent: $intent").let {
try {
intent.resolveActivity(packageManager)?.let {
startActivity(intent)
null
} ?: Exception("No activity found to handle the intent: $intent")
} catch (e: ActivityNotFoundException) {
Exception("Unable to open link", e)
} catch (e: Exception) {
Exception("An error occurred", e)
}.let {
Logger.e(it) { it.message.orEmpty() }
}
}
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/ProjectSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object ProjectSettings {

const val COMPILE_SDK_VERSION = 34
const val MIN_SDK_VERSION = 21
const val TARGET_SDK_VERSION = 33
const val TARGET_SDK_VERSION = 34

val JAVA_VERSION = JavaVersion.VERSION_21

Expand Down

0 comments on commit 70ede97

Please sign in to comment.