Questions tagged [android-camera-intent]

Questions related about calling the camera app from the local device, without the camera permission.

The camera intent is a way to make photos or videos with the camera app of the device without implementing a custom camera activity.

Here is a basic example for such a call:

// create Intent to take a picture and return control to the calling application
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); // create a file to save the image
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the image file name

// start the image capture Intent
startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);

See the full code on the documentation.

971 questions
3
votes
1 answer

Not able to display and save captured image on my screen in android studio

My code is working when i just display the capture image , its not working when i add the code to save captured image in gallery. public class MainActivity extends Activity { private static int RESULT_LOAD_IMG = 1; String…
Sivakumar S
  • 129
  • 2
  • 3
  • 16
3
votes
2 answers

Fragment gets destroyed 4 times when returning from Camera Intent

I have a simple fragment that when user taps on the screen it will send an Intent to open the Camera app and then expect an image to be returned. public void camera() { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); …
Arbitur
  • 38,684
  • 22
  • 91
  • 128
3
votes
1 answer

Android camera settings missing when launched by an Intent

When I launch the camera app manually, I have access to the settings for things like white balance, scale, resolution etc (via icons on the left hand side of the screen). However when I launch the camera via an intent these option icons are not…
Damian Helme
  • 1,060
  • 2
  • 10
  • 22
3
votes
2 answers

Android - take picture - onActivityResult returns immediately

In my App I would like to take a picture. The current Fragment is within a TabHost. Within a fragment I start the camera action with: Intent takePicture = new Intent( MediaStore.ACTION_IMAGE_CAPTURE); getActivity().startActivityForResult(…
tm1701
  • 7,307
  • 17
  • 79
  • 168
3
votes
0 answers

How to control video capture properties in android?

I am capturing video using the following intent: Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); if (takeVideoIntent.resolveActivity(getPackageManager()) != null) { …
BST Kaal
  • 2,993
  • 6
  • 34
  • 52
3
votes
3 answers

How to move image captured with the phone camera from one activity to an image view in another activity?

The first activity has a button which when clicked, opens the inbuilt camera. Now when the picture is taken, a new activity opens with the image captured in an imageView and a share button in the next activity. I have set up the activity to open…
3
votes
2 answers

How to get full size picture and thumbnail from Camera in the same intent

I've been needing to get a solution for this problem. I've already searched and tested many solutions from this community but anyone was fit for helping me. I have two activities, the first one takes a picture and sends it to another which has an…
DarK
  • 31
  • 1
  • 4
3
votes
0 answers

Deleting Inserted ContentValues

I have created custom intents for the user to choose photos or take a picture. Here's my Code: Intent pickIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI); pickIntent.setType("image/*"); values = new…
MetaSnarf
  • 5,857
  • 3
  • 25
  • 41
3
votes
3 answers

Correct way to handle camera app from fragment without ever crashing

Here is a re-occurring problem that I haven't found a good solution for in the past. My application is based on a single activity that has multiple child fragments. What i want to do: In some of my fragments, I want to take a picture with the phones…
3
votes
2 answers

Android Lollipop Camera2 api changing orientation of app

I am creating an application and part of it is where the user can change their profile picture either by taking a picture or using one from the native gallery. So I'm using the native camera and I'm using the following lines of code to open the…
3
votes
1 answer

Camera Image Capture Does Not Return Data - on Some Device(s)

I have started testing my app on a Moto E2, which is one of the first Android Lollipop devices on the marked. Turns out I'm unexpectedly having trouble capturing images with the camera. I cannot receive a picture. Creating an image capture intent…
user3386180
3
votes
1 answer

Why does my app crash after launching photo intent, but before onActivityResult() is called?

I am using the following code to request an image from the user: Intent pickIntent = new Intent(); pickIntent.setType("image/* video/*"); pickIntent.setAction(Intent.ACTION_GET_CONTENT); …
3
votes
1 answer

Data is null when capturing photo with camera (Nexus 7)

On some phones when I use the camera to load a new photo into an ImageView, the data I get back is null. On other phones it works fine. It works on most Kitkat phone's, but not on a Nexus 7 (4.4.2) and who know's on what else. Works on HTC M8…
erdomester
  • 11,789
  • 32
  • 132
  • 234
3
votes
1 answer

layout getHeight() and getWidth() return 0 when getting image from camera

I m creating a photo-frame app when i m getting image from gallery than it's working fine but when i try to get image from camera then my framelayout.getwidth() and framelayout.getHeight() method returns 0. My code given…
3
votes
1 answer

Samsung Camera Intent

let me address my issue here. i'm using an Intent to grab an image from the camera file by passing a file along the Intent to return it, however in my tests in the Samsung Galaxy S5, if the image was taken normally the image will return, but lets…
Kosh
  • 6,140
  • 3
  • 36
  • 67