3

我想列出已安装的应用程序和系统应用程序。系统应用程序是指预先安装的应用程序(在制造时安装的应用程序)。 为此,我使用(ApplicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0对所有应用程序进行了分类 - 这些应用程序是系统应用程序,其他应用程序均已安装。 现在我的问题是我想推出这些应用程序点击列表items.But我不能启动系统应用程序,如联系人,拨号等...如何以编程方式启动系统应用程序或如何过滤可启动的系统应用程序?

如何以编程方式启动系统应用程序或如何筛选出可启动的系统应用程序?

+0

检查此链接http://stackoverflow.com/questions/6382659/how-to-find-installed-applications-in- android?rq = 1 它有一个类似的问题 – Syn3sthete 2013-03-13 06:42:32

+0

我已经安装了系统应用程序。我想知道是否可以使用intent启动系统应用程序? – 2013-03-13 06:58:17

回答

4

我无法找到确切的answer.But我认为这将有帮助

List<PackageInfo> list = packageManager.getInstalledPackages(0); 
for (PackageInfo pi : list) { 
try { 
    ApplicationInfo appInfo = getPackageManager() .getApplicationInfo(pi.packageName, 0); 
     //check whether the app is launchable or not 
    if (packageManager .getLaunchIntentForPackage(appInfo.packageName) != null) { 
    //check whether the app is an installed/system app 
    if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) { 
     //system apps......... 
    } else { 
     //installed apps............ 
    } 
    } 

    } catch (Exception e) {} 
} 
相关问题