Camera intent for ACTION_IMAGE_CAPTURE does not appear on Samsung Galaxy Nexus(4.0.2)

前端 未结 1 1810
情歌与酒
情歌与酒 2020-12-06 07:36

I use following code take a Picture from camera and to obtain picture\'s path.

...
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_         


        
相关标签:
1条回答
  • 2020-12-06 08:25

    You are missing EXTRA_OUTPUT, which may impact matters. My Galaxy Nexus can run this sample project successfully, which uses the following code to request the picture:

    Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    File dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM);
    
    output = new File(dir, "CameraContentDemo.jpeg");
    i.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(output));
    
    startActivityForResult(i, CONTENT_REQUEST);
    
    0 讨论(0)
提交回复
热议问题