0

I am trying to retrieve a list of apps that are installed on the phone/emulator. I am using the following snippet to return the list of apps, however, it is returning null. Do I have to add some permission in Android Manifest or am I missing something else?

pManager = getPackageManager();
List<ApplicationInfo> appList =pManager.getInstalledApplications(PackageManager.GET_META_DATA);

if(appList == null)
   System.out.println("null");
Umer Farooq
  • 7,356
  • 7
  • 42
  • 67

1 Answers1

0

You need to add following permission

<uses-permission android:name="android.permission.GET_TASKS" />
Jabir
  • 2,776
  • 1
  • 22
  • 31