is Intent Available - Android android.content

Android examples for android.content:Intent

Description

is Intent Available

Demo Code

import java.util.List;

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

public class Main {

  public static boolean isIntentAvailable(Context context, Intent intent) {
    final PackageManager packageManager = context.getPackageManager();
    List<ResolveInfo> list = packageManager.queryIntentActivities(intent, PackageManager.GET_ACTIVITIES);
    return list.size() > 0;
  }/*ww w  .  j  a  v  a  2 s .  co  m*/

}

Related Tutorials