当前位置: 首页>>代码示例>>Java>>正文


Java PackageManager.queryIntentActivityOptions方法代码示例

本文整理汇总了Java中android.content.pm.PackageManager.queryIntentActivityOptions方法的典型用法代码示例。如果您正苦于以下问题:Java PackageManager.queryIntentActivityOptions方法的具体用法?Java PackageManager.queryIntentActivityOptions怎么用?Java PackageManager.queryIntentActivityOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.content.pm.PackageManager的用法示例。


在下文中一共展示了PackageManager.queryIntentActivityOptions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addIntentOptions

import android.content.pm.PackageManager; //导入方法依赖的package包/类
public int addIntentOptions(int group, int id, int categoryOrder, ComponentName caller, Intent[] specifics, Intent intent, int flags, MenuItem[] outSpecificItems) {
    PackageManager pm = this.mContext.getPackageManager();
    List<ResolveInfo> lri = pm.queryIntentActivityOptions(caller, specifics, intent, 0);
    int N = lri != null ? lri.size() : 0;
    if ((flags & 1) == 0) {
        removeGroup(group);
    }
    for (int i = 0; i < N; i++) {
        Intent intent2;
        ResolveInfo ri = (ResolveInfo) lri.get(i);
        if (ri.specificIndex < 0) {
            intent2 = intent;
        } else {
            intent2 = specifics[ri.specificIndex];
        }
        Intent rintent = new Intent(intent2);
        rintent.setComponent(new ComponentName(ri.activityInfo.applicationInfo.packageName, ri.activityInfo.name));
        MenuItem item = add(group, id, categoryOrder, ri.loadLabel(pm)).setIcon(ri.loadIcon(pm)).setIntent(rintent);
        if (outSpecificItems != null && ri.specificIndex >= 0) {
            outSpecificItems[ri.specificIndex] = item;
        }
    }
    return N;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:25,代码来源:MenuBuilder.java

示例2: addIntentOptions

import android.content.pm.PackageManager; //导入方法依赖的package包/类
public int addIntentOptions(int groupId, int itemId, int order,
        ComponentName caller, Intent[] specifics, Intent intent, int flags,
        MenuItem[] outSpecificItems) {
    PackageManager pm = mContext.getPackageManager();
    final List<ResolveInfo> lri =
            pm.queryIntentActivityOptions(caller, specifics, intent, 0);
    final int N = lri != null ? lri.size() : 0;

    if ((flags & FLAG_APPEND_TO_GROUP) == 0) {
        removeGroup(groupId);
    }

    for (int i=0; i<N; i++) {
        final ResolveInfo ri = lri.get(i);
        Intent rintent = new Intent(
            ri.specificIndex < 0 ? intent : specifics[ri.specificIndex]);
        rintent.setComponent(new ComponentName(
                ri.activityInfo.applicationInfo.packageName,
                ri.activityInfo.name));
        final MenuItem item = add(groupId, itemId, order, ri.loadLabel(pm))
                .setIcon(ri.loadIcon(pm))
                .setIntent(rintent);
        if (outSpecificItems != null && ri.specificIndex >= 0) {
            outSpecificItems[ri.specificIndex] = item;
        }
    }

    return N;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:30,代码来源:ActionMenu.java

示例3: addIntentOptions

import android.content.pm.PackageManager; //导入方法依赖的package包/类
public int addIntentOptions(int group, int id, int categoryOrder, ComponentName caller,
        Intent[] specifics, Intent intent, int flags, MenuItem[] outSpecificItems) {
    PackageManager pm = mContext.getPackageManager();
    final List<ResolveInfo> lri =
            pm.queryIntentActivityOptions(caller, specifics, intent, 0);
    final int N = lri != null ? lri.size() : 0;

    if ((flags & FLAG_APPEND_TO_GROUP) == 0) {
        removeGroup(group);
    }

    for (int i=0; i<N; i++) {
        final ResolveInfo ri = lri.get(i);
        Intent rintent = new Intent(
            ri.specificIndex < 0 ? intent : specifics[ri.specificIndex]);
        rintent.setComponent(new ComponentName(
                ri.activityInfo.applicationInfo.packageName,
                ri.activityInfo.name));
        final MenuItem item = add(group, id, categoryOrder, ri.loadLabel(pm))
                .setIcon(ri.loadIcon(pm))
                .setIntent(rintent);
        if (outSpecificItems != null && ri.specificIndex >= 0) {
            outSpecificItems[ri.specificIndex] = item;
        }
    }

    return N;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:29,代码来源:MenuBuilder.java


注:本文中的android.content.pm.PackageManager.queryIntentActivityOptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。