Android Intent Check isIntentAvailable(Context context, String action)

Here you can find the source of isIntentAvailable(Context context, String action)

Description

is Intent Available

License

Open Source License

Declaration

static boolean isIntentAvailable(Context context, String action) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.List;

import android.content.Context;
import android.content.Intent;

import android.content.pm.PackageManager;

public class Main {
    static boolean isIntentAvailable(Context context, String action) {
        final PackageManager packageManager = context.getPackageManager();
        final Intent intent = new Intent(action);
        List resolveInfo = packageManager.queryIntentActivities(intent,
                PackageManager.MATCH_DEFAULT_ONLY);
        if (resolveInfo.size() > 0) {
            return true;
        }// ww  w.  j a v a  2 s. co m
        return false;
    }
}

Related

  1. isBroadcastSafe(Context context, Intent intent)
  2. isIntentAvailable(Context context, String action)
  3. isIntentSafe(Context context, Intent intent)
  4. genPendingBroadcast(Context context, int requestCode, Intent broadcastIntent)
  5. isIntentAvailable(@Nonnull Context context, @Nonnull String action)
  6. isDownloadsDocument(Uri uri)
  7. isExternalStorageDocument(Uri uri)
  8. isMediaDocument(Uri uri)
  9. isCallable(Context c, Intent intent)