Android examples for App:App Install
is PDF Apps Exists
//package com.java2s; import java.util.List; import android.content.Context; import android.content.Intent; import android.content.pm.ResolveInfo; public class Main { public static boolean isPDFAppsExists(Context context) { Intent intent = new Intent(Intent.ACTION_VIEW); // we just query the app exists or not, no need the Uri data. intent.setDataAndType(null, "application/pdf"); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // queryMatchIntent() never return null. return queryMatchIntent(context, intent).size() > 0; }// w ww . j av a 2s .co m /** * Return matching activities list or an empty list if no matching. * * @param context * @param intent * @return */ public static List<ResolveInfo> queryMatchIntent(Context context, Intent intent) { // You can use ResolveInfo.activityInfo.packageName or ResolveInfo.activityInfo.name to filter intents. return context.getPackageManager().queryIntentActivities(intent, android.content.pm.PackageManager.MATCH_DEFAULT_ONLY); } }