在Apk应用程序内,查找某个Activity。

转载请注明出处:http://blog.csdn.net/droyon/article/details/39933677

Intent intent = new Intent(Intent.ACTION_APP_ERROR);
        intent.setPackage(receiverPackage);
        ResolveInfo info = pm.resolveActivity(intent, 0);
        if (info == null || info.activityInfo == null) {
            return null;
        }

 return new ComponentName(receiverPackage, info.activityInfo.name);

假设存在,则info.activityInfo.name就是要查找的应用名称。

posted @ 2016-01-10 17:53  mengfanrong  阅读(242)  评论(0编辑  收藏  举报