Android ACTION_IMAGE_CAPTURE Intent

后端 未结 14 1985
被撕碎了的回忆
被撕碎了的回忆 2020-11-22 02:04

We are trying to use the native camera app to let the user take a new picture. It works just fine if we leave out the EXTRA_OUTPUT extra and returns the small B

14条回答
  •  伪装坚强ぢ
    2020-11-22 02:58

    It is very simple to solve this problem with Activity Result Code Simple try this method

    if (reqCode == RECORD_VIDEO) {
       if(resCode == RESULT_OK) {
           if (uri != null) {
               compress();
           }
        } else if(resCode == RESULT_CANCELED && data!=null){
           Toast.makeText(MainActivity.this,"No Video Recorded",Toast.LENGTH_SHORT).show();
       }
    }
    

提交回复
热议问题