INTENT_ACTION_VIDEO_CAMER或INTENT_ACTION_STILL_IMAGE_CAMERA onActivityResult

时间:2016-02-14 16:34:56

标签: android android-intent camera

    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Intent cameraIntent = new Intent(MediaStore.INTENT_ACTION_VIDEO_CAMERA);
    //Intent cameraIntent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);


    //cameraIntent.putExtra(
      //      MediaStore.EXTRA_OUTPUT, (new File(Environment.getExternalStorageDirectory(),
        //            String.valueOf(System.currentTimeMillis()) + ".jpg"))
    //);
    startActivityForResult(cameraIntent, 3220);

}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if(requestCode == 3220){
        Log.d("ank", "activity");

    }
    Log.d("ank", "activity1");

}

当我使用Intent_ACTION_VIDEO_CAMERA或Intent_Action_Still_Image_Camera

时,我无法获得onActivityResult

当我使用Action_Image_Capture时,我会调用onActivityResult。

我只想使用上面两个Intent因为使用Action_Image_Camera视频选项时不来

1 个答案:

答案 0 :(得分:0)

  

当我使用Intent_ACTION_VIDEO_CAMERA或Intent_Action_Still_Image_Camera

时,我无法获得onActivityResult

记录INTENT_ACTION_STILL_IMAGE_CAMERAINTENT_ACTION_VIDEO_CAMERA都不会返回结果。我希望支持这些Intent操作的大多数应用都不会返回结果。