code: public static boolean maybeStartActivity(Context context, Intent intent) {
          if (hasHandler(context, intent)) {
              context.startActivity(intent);
              return true;
          } else {
              Toast.makeText(context, "There are no applications available to handle this action",
                  Toast.LENGTH_LONG).show();
              return false;
          }
      }
docs: Attempt to launch the supplied {@link Intent}. Queries on-device packages before launching and
  will display a simple message if none are available to handle it.