直播短视频源码,获取系统应用信息的相关代码
代码语言:javascript复制 Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final PackageManager packageManager = getPackageManager();
List<ResolveInfo> apps = null;
apps = packageManager.queryIntentActivities(mainIntent, 0);
mNameList = new ArrayList<String>();
mDrawableList = new ArrayList<Drawable>();
mNameList.clear();
mDrawableList.clear();
if(apps != null && apps.size() > 0)
{
for (int i = 0; i < apps.size(); i )
{
mNameList.add((String) apps.get(i).loadLabel(packageManager));//获取应用名称
mDrawableList.add(apps.get(i).loadIcon(packageManager)); //获取应用图片
System.out.println(apps.get(i).loadLabel(packageManager));
}
}
以上就是 直播短视频源码,获取系统应用信息的相关代码,更多内容欢迎关注之后的文章