You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Android系统存在多用户时,很多应用无法遍历,提示no activities found to run,相关代码如下:
for (int i = 0; i < N; i++) {
Intent intent = new Intent(Intent.ACTION_MAIN);
String category = mMainCategories.get(i);
if (category.length() > 0) {
intent.addCategory(category);
}
List mainApps = APIAdapter.queryIntentActivities(packageManager, intent);
if (mainApps == null || mainApps.size() == 0) {
Logger.warningPrintln("// Warning: no activities found for category " + category);
continue;
}
if (mVerbose >= 2) { // very verbose
Logger.println("// Selecting main activities from category " + category);
}
final int NA = mainApps.size();
for (int a = 0; a < NA; a++) {
ResolveInfo r = mainApps.get(a);
String packageName = r.activityInfo.applicationInfo.packageName;
if (MonkeyUtils.getPackageFilter().checkEnteringPackage(packageName)) {
if (mVerbose >= 2) { // very verbose
Logger.println("// + Using main activity " + r.activityInfo.name + " (from package "
+ packageName + ")");
}
mMainApps.add(new ComponentName(packageName, r.activityInfo.name));
} else {
if (mVerbose >= 2) { // very very verbose
Logger.println("// - NOT USING main activity " + r.activityInfo.name
+ " (from package " + packageName + ")");
}
}
}
}
The text was updated successfully, but these errors were encountered:
Android系统存在多用户时,很多应用无法遍历,提示no activities found to run,相关代码如下:
for (int i = 0; i < N; i++) {
Intent intent = new Intent(Intent.ACTION_MAIN);
String category = mMainCategories.get(i);
if (category.length() > 0) {
intent.addCategory(category);
}
List mainApps = APIAdapter.queryIntentActivities(packageManager, intent);
The text was updated successfully, but these errors were encountered: