Skip to content

Commit f9483c1

Browse files
committed
Fix a deprecation
1 parent f0f46d7 commit f9483c1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app-base/src/main/java/xyz/aprildown/timer/app/base/utils/WebsiteOpener.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import android.content.Context
55
import android.content.Intent
66
import androidx.browser.customtabs.CustomTabColorSchemeParams
77
import androidx.browser.customtabs.CustomTabsIntent
8-
import androidx.core.content.ContextCompat
98
import androidx.core.net.toUri
109
import com.github.deweyreed.tools.helper.isDarkTheme
1110
import xyz.aprildown.timer.app.base.data.DarkTheme
@@ -61,7 +60,10 @@ private fun Context.openWebsiteWithCustomTabs(url: String) {
6160
try {
6261
cti.launchUrl(this, uri)
6362
} catch (_: ActivityNotFoundException) {
64-
ContextCompat.startActivity(this, Intent.createChooser(cti.intent.setData(uri), null), null)
63+
try {
64+
startActivity(Intent.createChooser(cti.intent.setData(uri), null))
65+
} catch (_: ActivityNotFoundException) {
66+
}
6567
}
6668
}
6769

0 commit comments

Comments
 (0)