Catch more exceptions for startActivity

This commit is contained in:
Mygod
2019-02-22 12:10:22 +08:00
parent 8daf4fbdb0
commit 5954029a7c
3 changed files with 10 additions and 19 deletions

View File

@@ -14,6 +14,7 @@ import androidx.databinding.BindingAdapter
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.room.macToString
import be.mygod.vpnhotspot.widget.SmartSnackbar
import java.lang.RuntimeException
import java.net.InetAddress
import java.net.NetworkInterface
import java.net.SocketException
@@ -79,7 +80,7 @@ fun Context.launchUrl(url: String) {
if (app.hasTouch) try {
app.customTabsIntent.launchUrl(this, url.toUri())
return
} catch (_: ActivityNotFoundException) { } catch (_: SecurityException) { }
} catch (_: RuntimeException) { }
SmartSnackbar.make(url).show()
}