diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/util/IntentUtils.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/util/IntentUtils.kt index c7e3adbe4..96f9fec45 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/util/IntentUtils.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/util/IntentUtils.kt @@ -194,17 +194,7 @@ object IntentUtils { } val intent = Intent(Intent.ACTION_VIEW) intent.addCategory(Intent.CATEGORY_BROWSABLE) - val testBuilder = Uri.Builder() - testBuilder.scheme(SCHEME_HTTP) - val sb = StringBuilder() - val random = Random() - val range = 'z' - 'a' - for (i in 0..19) { - sb.append(('a' + Math.abs(random.nextInt()) % range)) - } - sb.append(".com") - testBuilder.authority(sb.toString()) - intent.data = testBuilder.build() + intent.data = Uri.parse("${uri.scheme}://") return intent.resolveActivity(context.packageManager)?.takeIf { it.className != null && it.packageName != "android" diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/util/OnLinkClickHandler.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/util/OnLinkClickHandler.kt index 0af06db0f..ca6c4c8eb 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/util/OnLinkClickHandler.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/util/OnLinkClickHandler.kt @@ -181,11 +181,13 @@ open class OnLinkClickHandler( companion object { fun openLink(context: Context, preferences: SharedPreferences, uri: Uri) { - val (intent, options) = IntentUtils.browse(context, preferences, uri = uri) + val (intent, options) = IntentUtils.browse(context, preferences, uri = uri, + forceBrowser = false) try { ContextCompat.startActivity(context, intent, options) } catch (e: ActivityNotFoundException) { - // Ignore + Analyzer.logException(e) + DebugLog.w(tr = e) } } }