src/main/java/de/blau/android/util/Util.java
/**
     * Check if a specific package is installed
     * 
     * @param packageName the name of the package
     * @param packageManager a PackageManager instance
     * @return true if the package is installed
     */
Check if a specific package is installed

@param packageName the name of the package
@param packageManager a PackageManager instance
@return true if the package is installed
Check if a specific package is installed @param packageName the name of the package @param packageManager a PackageManager instance @return true if the package is installed
public static boolean isPackageInstalled(@NonNull String packageName, @NonNull PackageManager packageManager) {
        try {
            packageManager.getPackageInfo(packageName, 0);
            return true;
        } catch (PackageManager.NameNotFoundException e) {
            return false;
        }
    }
public static boolean isPackageInstalled ( @ NonNull String packageName , @ NonNull PackageManager packageManager ) { try { packageManager . getPackageInfo ( packageName , 0 ) ; return true ; } catch ( PackageManager . NameNotFoundException e ) { return false ; } }
Check if a specific package is installed
Check if a specific package is installed