Those who are looking for Kotlin solution can use this method,
Here I have shared full code, and also handled enabled status. Check If Application is Installed in Android Kotlin
fun isAppInstalled(packageName: String, context: Context): Boolean {
return try {
val packageManager = context.packageManager
packageManager.getPackageInfo(packageName, 0)
true
} catch (e: PackageManager.NameNotFoundException) {
false
}
}