标签:blog io java for on 2014 log cti as
//得到所有Activity public void getAllActivities(Context context){ try { //第一步:得到PackageName String packageName=context.getPackageName(); //第二步:得到PackageManager PackageManager packageManager=context.getPackageManager(); //第三步:得到PackageInfo PackageInfo packageInfo=packageManager.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES); //第四步:得到ActivityInfo[] ActivityInfo[] activityInfoList = packageInfo.activities; //第五步:得到每一个Activity for (ActivityInfo activityInfo : activityInfoList) { System.out.println(""+activityInfo.name); } } catch (Exception e) { // TODO: handle exception } }
标签:blog io java for on 2014 log cti as
原文地址:http://blog.csdn.net/lfdfhl/article/details/41705211