Make app as default to open a file
boeckMt opened this issue · 0 comments
boeckMt commented
Feature
open gpx or json files with tha app?
- for android
// https://stackoverflow.com/questions/9872450/make-your-app-a-default-app-to-open-a-certain-file
Intent(Intent.ACTION_VIEW).apply {
try {
type = "application/pdf"
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
startActivity(this)
} catch (e: Exception) {
toast("No app can handle this")
}
}