code: public static boolean isIntentAvailable(Context context, String action, String mimeType) {
          final Intent intent = new Intent(action);
          if (mimeType != null) {
              intent.setType(mimeType);
          }
          List<ResolveInfo> list = context.getPackageManager().queryIntentActivities(intent,
                  PackageManager.MATCH_DEFAULT_ONLY);
          return !list.isEmpty();
      }
docs: Checks whether there are applications installed which are able to handle the given action/type.
  
  @param context  the current context
  @param action   the action to check
  @param mimeType the MIME type of the content (may be null)
  @return true if there are apps which will respond to this action/type