Code example for Context

Methods: getPackageManager

    public static boolean isIntentAvailable(Context context, String action, Uri uri, String mimeType) {
        final Intent intent = (uri != null) ? new Intent(action, uri) : new Intent(action);
        if (mimeType != null) {
        List<ResolveInfo> list = context.getPackageManager().queryIntentActivities(intent,
        return !list.isEmpty();
     * 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) 
Stop searching for code, let great code find you!  Add Codota to your java IDE