Add this permission in the AndroidManifest.xml
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />