get Intent Receive App Count - Android App

Android examples for App:APK Information

Description

get Intent Receive App Count

Demo Code


//package com.java2s;

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

public class Main {
    public static int getIntentReceiveAppCount(Context context,
            Intent intent) {/*from   w  w  w. j av a  2  s .c  o m*/
        PackageManager pm = context.getPackageManager();
        return pm.queryIntentActivities(intent,
                PackageManager.MATCH_DEFAULT_ONLY).size();
    }
}

Related Tutorials