How to take multiple images using camera in android

前端 未结 2 1124
庸人自扰
庸人自扰 2021-01-22 04:22

I need a camera that allows me take multiple pictures at once and then select one. Others may or may not be stored on the device. I\'ve tried this. I can take multiple images bu

相关标签:
2条回答
  • 2021-01-22 04:40

    You have to implement your own camera to take multiple pictures. Create a class with surface view and implements SurfaceView.Callback. Please check out my library which will implement the same.

    https://github.com/SripadRaj/BurstCamera

    0 讨论(0)
  • 2021-01-22 04:48

    Try this

    you can Call your second startActivityForResult() from the onActivityResult() you get from your first startActivityForResult().

    like this by this code you can get 10 pic

    public int PIC_CODE=0;
    
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {  
        if (requestCode == CAMERA_REQUEST && resultCode == Activity.RESULT_OK) {  
    
            // get new image here like this
           if(PIC_CODE<10){
                // add new requset of picture like this
                Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); 
                startActivityForResult(cameraIntent, CAMERA_REQUEST); 
                PIC_CODE++;
        }  
    } 
    
    0 讨论(0)
提交回复
热议问题