android如何获取到启动类的包和类路径
ArrayList<String> list = new ArrayList<String>(); private List<ResolveInfo> mApps; private ResolveInfo info; public void list() { list.clear(); Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); mApps = getPackageManager().queryIntentActivities(mainIntent, 0); for (int i = 0; i < mApps.size(); i++) { info = mApps.get(i); String appLabel = info.loadLabel(getPackageManager()).toString(); String packagename = info.activityInfo.packageName; String appname = info.activityInfo.name; list.add("appLabel:" + appLabel + " || packagename:" + packagename + " || appname:" + appname); } noteText.setText(list.toString()); }