Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a51539ee authored by tibbi's avatar tibbi
Browse files

use a mimetype */* if every previous way failed

parent 67cd9d79
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '2.41.1'
        propVersionName = '2.41.2'
        kotlin_version = '1.1.60'
        support_libs = '27.0.1'
    }
+5 −1
Original line number Diff line number Diff line
@@ -210,7 +210,11 @@ fun Activity.getUriMimeType(oldUri: Uri, newUri: Uri): String {
}

fun Activity.tryGenericMimeType(intent: Intent, mimeType: String, uri: Uri): Boolean {
    val genericMimeType = mimeType.getGenericMimeType()
    var genericMimeType = mimeType.getGenericMimeType()
    if (genericMimeType.isEmpty()) {
        genericMimeType = "*/*"
    }

    intent.setDataAndType(uri, genericMimeType)
    return if (intent.resolveActivity(packageManager) != null) {
        startActivity(intent)