检查有没有应用程序来接受处理你发出的intent

四、检查有没有应用程序来接受处理你发出的intent

复制代码
    public static boolean isIntentAvailable(Context context, String action) {
        final PackageManager packageManager = context.getPackageManager();
        final Intent intent = new Intent(action);
        ListResolveInfo list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
        return list.size()  0;
    }
复制代码
最新回复(0)
/jishuhJy2kPm6BCAbgi_2BGAylA6s_2BFixUW7VCnhn7U_2F4M9oZs_3D4858540
8 简首页