Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch default camera app (no return)

I'd like to launch the default camera, but want it to act like it was started from the launcher (i.e. the resulting picture should be stored by the camera app to the user's gallery, rather than being returned to my app). If I use Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);, the camera app uses the "OK? Retry?"-UI and doesn't save the picture. I'd rather not use a "direct" com.android.camera intent, because a lot of devices use custom camera apps. I've seen that the stock gallery3d-app uses an alias implementing com.android.camera/.Camera, but I'm not sure that every pre-loaded manufacturer camera app does this.

like image 405
Nick Avatar asked Sep 03 '13 18:09

Nick


People also ask

How do I open my camera to default?

go to settings, apps, (google) camera, "open by default", and click on "clear defaults". Now when you double tap power button, it will ask you again which app to use and you can set it as default whichever you want to use.

How can I open camera on click button?

To open up your webcam or camera, select the Start button, then select All apps, and then select Camera in the list of apps.


1 Answers

This code will do the trick:

Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
context.startActivity(intent);
like image 161
AChep Avatar answered Oct 13 '22 00:10

AChep