Using intent to use Camera in Android

后端 未结 5 1625
栀梦
栀梦 2021-02-14 19:02

I am using the following code to use camera by using intent. In the parameter of intent I am passing android.provider.MediaStore.ACTION_IMAGE_CAPTURE. It is able to

5条回答
  •  甜味超标
    2021-02-14 19:45

    do you have the following declarations in your manifest ?:

    
    
    
    

    ?? I used to do the same... here is my call to intent:

    File file = new File( _path );
        Uri outputFileUri = Uri.fromFile( file );
    
        Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );
        intent.putExtra( MediaStore.EXTRA_OUTPUT, outputFileUri );
        intent.putExtra( MediaStore.EXTRA_VIDEO_QUALITY,1);
    

    the only slight difference between my and your code - I have file path in URI sending among call

提交回复
热议问题