
Кто-нибудь знает, как определить по коду, если приложение не установлено, как здесь, на Google TV?
fun isPackageInstalled(context: Context, packageName: String): Boolean =
packageInfo(context, packageName) != null
fun packageInfo(context: Context, packageName: String): PackageInfo? {
return try {
context.packageManager.getPackageInfo(packageName, 0)
} catch (e: PackageManager.NameNotFoundException) {
null
}
}
Исключение, возникающее при запуске активности для Viaplay
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=https://viaplay.no/... flg=0x10000000 pkg=com.viaplay.android }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2239)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1878)
at android.app.ContextImpl.startActivity(ContextImpl.java:1132)
at android.app.ContextImpl.startActivity(ContextImpl.java:1103)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:436)
...
Подробнее здесь: https://stackoverflow.com/questions/791 ... -google-tv
Мобильная версия