android - Capture Images With Intent without clicking the camera button again -


I want to get images through intent

Intent camera element = new intent (android. Provider.MediaStore ACTION_IMAGE_CAPTURE)

But the problem is that the camera has started with this code and the user has to capture the image to click the camera button, but what do I need to start the camera shodd

INTENT

This is the way I like Have done: Announce the camera example, and the Surfall Holder

Create an object callback, and implement the method on Chitrakoot (the method is launched when you want to take a picture)

  mSurfaceHolder.setType (SurfaceHolder. SURFACE_TYPE_PUSH_BUFFERS); Camera Picturecrollback mCall = new camera.Picture callback () {@ProfitureTake public spaces (byte [] data, camera camera) {// your stuff}}; // Open the camera example mCamera = Camera.open (); {// Call on preview (Not sure that this is working without this call mCamera.setPreviewDisplay (mSurfaceHolder); mCamera.startPreview ();} Catch (IOException e) {// TODO Auto generated blocking block .printStackTrace ();} If (mCamera == null) Log.i (TAG, "mCamera is null"); // Apply on. Apply the above documentation / look at the document: Public Ultimate Zero LenaPicture mcamera .takePicture (empty, empty, mCall); MCamera.stopPreview (); mCamera.release ();   

By modifying it, be able to do what you want Do not forget to modify Manifest.XML, but I think you have done it already!

EDIT: Sometimes with stoppreview () and release () The problem is .. So, the work I have done is:

  if (mCamera! = Null) {mCamera.release (); mCamera = null;} mCamera = Camera.open () ; Etc ...    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -