Android Intent Check isCallable(Context c, Intent intent)

Here you can find the source of isCallable(Context c, Intent intent)

Description

is Callable

License

Open Source License

Declaration

public static boolean isCallable(Context c, Intent intent) 

Method Source Code

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

import android.content.Context;

import android.content.Intent;

import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;

import java.util.List;

public class Main {
    public static boolean isCallable(Context c, Intent intent) {
        List<ResolveInfo> list = c.getPackageManager()
                .queryIntentActivities(intent,
                        PackageManager.MATCH_DEFAULT_ONLY);
        return list.size() > 0;
    }/*from w  w w  .  j a  v  a  2s. c om*/
}

Related

  1. isIntentAvailable(@Nonnull Context context, @Nonnull String action)
  2. isIntentAvailable(Context context, String action)
  3. isDownloadsDocument(Uri uri)
  4. isExternalStorageDocument(Uri uri)
  5. isMediaDocument(Uri uri)
  6. isCommonIntentUrl(String url)
  7. isIntentAvailable(final Context context, final String action)
  8. isIntentUrl(String url)
  9. isPlayMarketIntentUrl(String url)