mercredi 6 mai 2015

Take photo from front camera using intent [duplicate]

This question already has an answer here:

I'm using intent to call the camera to capture a photo, but this time I need to call the front camera instead of the rear one. So is this possible in android, and if so how can I make the call?

Here is what I'm doing right now:

intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
            photoImageFile = ImageUtil.getTempFile(this);
            photoImagePath = photoImageFile.getPath();
            if(getIntent().getBooleanExtra(IntentConstants.FRONT_CAMERA,false)){
                //TODO call front camera
            }
            intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoImageFile));
            startActivityForResult(intent, RequestCode.FROMCAMERA);

Aucun commentaire:

Enregistrer un commentaire