In my App, I want to get all the app installed, code like this
PackageManager packageManager = getPackageManager();
Intent intent = new Intent();
intent.setAction(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> resolveInfos = packageManager.queryIntentActivities(intent, 0);
when I give the permission of READ_PHONE_STATE. I get all the apps, But when I refuse, I get only three app info, it makes me confuse. anyone can explain it. thanks