Device: Emulator pixel 3a - Android 11
Code:
final List<Intent> cameraIntents = new ArrayList<Intent>();
final Intent captureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
final List<ResolveInfo> listCam =
context.getPackageManager().queryIntentActivities(captureIntent, 0);
When using:
targetSdkVersion 30
compileSdkVersion 30
listCam size is 0
and when changing to:
compileSdkVersion 29
listCam size is 1 - as it should be.
Using the following code:
val captureIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
baseActivity.startActivity(captureIntent)
Works fine and shows the camera app.
Any idea why queryIntentActivities is not returning the camera intent?
Thanks!