我正在使用本机相机意图来捕捉视频。在 Nexus S 中,如果我捕获视频,那么无论我取消还是按下确定,视频文件都会存储在默认的 Medi URI 路径中。但是我需要在用户单击确定时删除捕获的视频。我正在使用以下代码调用相机
Intent videoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
startActivityForResult(videoIntent, CAPTURE_VIDEO);
和下面的 ciode 处理取消按钮点击事件
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
try {
if (requestCode == CAPTURE_VIDEO) {if(resultCode == Activity.RESULT_CANCELED)
//pointer comes here successfully. It tells that cancel button is clicked. But I am unabelt to know how to delete the currently cancelled video
}
}
}