Android获取应用程序下所有Activity

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

    public static ArrayList<String> getActivities(Context ctx) {
          ArrayList<String> result = new ArrayList<String>();
          Intent intent = new Intent(Intent.ACTION_MAIN, null);
          intent.setPackage(ctx.getPackageName());
          for (ResolveInfo info : ctx.getPackageManager().queryIntentActivities(intent, 0)) {
              result.add(info.activityInfo.name);
          }
          return result;
      }