可能重复:
How to get a list of installed android applications and pick one to run
我们使用的是Android手机。
All Installed Applications
。All Running Applications
。帮助我。感谢。
答案 0 :(得分:24)
获取Android上安装的活动/应用程序列表:
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);
参考:How to get a list of installed android applications and pick one to run
检查所有正在运行的应用程序
ActivityManager actvityManager = (ActivityManager)
this.getSystemService( ACTIVITY_SERVICE );
List<RunningAppProcessInfo> procInfos = actvityManager.getRunningAppProcesses();
参考:http://www.dreamincode.net/forums/topic/138412-android-20-list-of-running-applications/
注意:上述功能将返回以下API 21的正确结果,对于21及以上,它已被弃用。