Skip to content
Snippets Groups Projects
Commit ffba0877 authored by Diego Fernando Nieto's avatar Diego Fernando Nieto Committed by Nicolas Pomepuy
Browse files

License: Make sure a web browser is installed on the device else fallback on Webview

parent e23e2c1e
No related branches found
No related tags found
1 merge request!645License: Make sure a web browser is installed on the device else fallback on Webview
Pipeline #19720 passed with stage
in 2 minutes and 32 seconds
package org.videolan.television.ui
import android.annotation.SuppressLint
import android.content.ActivityNotFoundException
import android.content.Intent
import android.net.Uri
import android.os.Bundle
......@@ -42,7 +43,12 @@ class LicenceActivity : FragmentActivity() {
view.loadUrl(url)
} else {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
startActivity(intent)
try {
startActivity(intent)
} catch (e: ActivityNotFoundException) {
view.loadUrl(url)
}
}
return true
}
......
......@@ -21,6 +21,7 @@
package org.videolan.vlc.gui
import android.annotation.SuppressLint
import android.content.ActivityNotFoundException
import android.content.Intent
import android.content.res.Configuration
import android.net.Uri
......@@ -109,7 +110,12 @@ class AboutFragment : Fragment() {
view.loadUrl(url)
} else {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
startActivity(intent)
try {
startActivity(intent)
} catch (e: ActivityNotFoundException) {
view.loadUrl(url)
}
}
return true
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment