Here you can find the source of intentAvailable(Context context, Intent intent)
Parameter | Description |
---|---|
context | a parameter |
intent | a parameter |
public static boolean intentAvailable(Context context, Intent intent)
//package com.java2s; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; public class Main { /**/*w w w.java2 s. c o m*/ * checks if a given intent can be called on the system * * @param context * @param intent * @return */ public static boolean intentAvailable(Context context, Intent intent) { return context .getPackageManager() .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY).size() > 0; } }