List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES); for (int n=0;n<list.size();n++) { if((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM)==1) { Log.d("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString()); Log.d("TAG", "package name : " + list.get(n).packageName); if(list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) { defaultCameraPackage = list.get(n).packageName; break; } } }
I found the following solution and its work is excellent.
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); takePictureIntent.setPackage(defaultCameraPackage); startActivityForResult(takePictureIntent, actionCode);
You can filter the camera by default by installing the package in the above intention. I tested it by installing the two applications Linear Camera and Paper Camera . Both applications showed a choice, but filtering by package above the code is open only by default.
source share