/**
* Get target package activities.
* @param context context
* @return activities
*/
public ActivityInfo[] getAllActivities(Context context){
try {
PackageManager pm = context.getPackageManager();
PackageInfo info = pm.getPackageInfo(context.getPackageName(), PackageManager.GET_ACTIVITIES);
return info.activities;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
return null;
}
网友评论