android: Take camera picture without “save” / “delete” confirmation

前端 未结 6 1126
醉酒成梦
醉酒成梦 2020-12-01 11:26

I want to display an image taken from the camera in an ImageView using

Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
         


        
6条回答
  •  青春惊慌失措
    2020-12-01 11:42

    Use "android.intent.extra.quickCapture"

    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    intent.putExtra("android.intent.extra.quickCapture",true);
    if (intent.resolveActivity(getPackageManager()) != null) {
        startActivityForResult(intent, REQUEST_IMAGE_CAPTURE);
    }
    

提交回复
热议问题