LHA
LHA

Reputation: 9645

Android Camera Intent only shows stock camera instead of all camera apps

I am integrating taking photo into my app using existing installed camera apps. On my phone, there are some camera apps installed, but I can only see the one that shipped with the phone.

Here is my code:

Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (takePictureIntent.resolveActivity(getActivity().getPackageManager()) != null) {
    File tempFile = // ....            
    Uri photoURI = FileProvider.getUriForFile(getActivity(), "my_fileprovider", tempFile);

    takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);

    startActivityForResult(takePictureIntent, RC_CAMERA_RETURN);
}

What I expected:

The app will show a list of installed camera apps and the user can pick up one.

My phone info: Sony Xperia Z2 with the following installed camera apps

Upvotes: 0

Views: 135

Answers (2)

Anuj Jindal
Anuj Jindal

Reputation: 1719

you can use to get app's manifest and get the Intent action and you can directly add action to the intent, check App to check manifest of any app installed in android link here

That's How I solved same problem.

Upvotes: 1

Alexander Pacha
Alexander Pacha

Reputation: 9710

I'm afraid that the target app you are referring to did not register itself appropriately as camera app.

If you know exactly what app you want to open, you might specify that information in an explicit Intent to open that particular app. Otherwise the user has to pick one of the available apps.

Upvotes: 1

Related Questions