Qamar Khan
03/20/2023, 12:19 PMval isAppInstalled = try {
packageManager.getApplicationInfo(appPackageName, 0)
true
} catch (e: PackageManager.NameNotFoundException) {
false
}
if (isAppInstalled) {
val launchIntent = packageManager.getLaunchIntentForPackage(appPackageName)
startActivity(launchIntent)
} else {
val playStoreIntent = Intent(
Intent.ACTION_VIEW,
Uri.parse(playStoreLink)
)
startActivity(playStoreIntent)
}
Thomas Urbanitsch
03/20/2023, 12:35 PM