public static boolean packageInstalled ( @ NotNull final Context context , @ NotNull final String packageName ) { final PackageManager packageManager = context . getPackageManager ( ) ; boolean result = false ; try { packageManager . getPackageInfo ( packageName , PackageManager . GET_ACTIVITIES ) ; result = true ; } catch ( PackageManager . NameNotFoundException ignore ) { } Logger . d ( "packageInstalled() is " , result , " for " , packageName ) ; return result ; }
Checks if an application is installed .