3

I want to make a list of installed and system applications. system applications means the pre-installed applications (applications which are installed at the time of manufacture). For this i categorized all the apps using (ApplicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0 - which are system apps and others are installed apps. Now my problem is i want to launch these apps on click of list items.But i could not launch system apps like Contacts,Dialer etc...

How to launch system apps programmatically or how to filter out launchable system apps?

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Devu Soman
  • 2,246
  • 13
  • 36
  • 57
  • check this link http://stackoverflow.com/questions/6382659/how-to-find-installed-applications-in-android?rq=1 it has a similar question – Syn3sthete Mar 13 '13 at 06:42
  • I got installed and system apps.I want to know that is it possible to launch system apps using intent? – Devu Soman Mar 13 '13 at 06:58

1 Answers1

4

I could not found exact answer.But i think it will helpful

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) {}
}
Devu Soman
  • 2,246
  • 13
  • 36
  • 57