This commit is contained in:
Tommaso Berlose
2020-05-22 18:30:38 +02:00
parent 9e40586456
commit 0d2287dbdf
4 changed files with 35 additions and 11 deletions

View File

@ -221,4 +221,13 @@ fun Context.checkIfFitInstalled(): Boolean {
} catch (e: Exception) {
false
}
}
fun Intent.isDefaultSet(context: Context): Boolean {
val pm = context.packageManager
return try {
resolveActivity(pm) != null && resolveActivity(pm).packageName.isNotBlank()
} catch (ex: java.lang.Exception) {
false
}
}