功能:
启动手机相机和摄像机
取出相机保存的图片路径
取出摄像机拍摄的视频文件路径
将摄像机拍摄的视频的作为UI的内容
Intent iimg = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
*phoneFile* = new File(Environment.getExternalStorageDirectory()
.getAbsoluteFile() + "/" + **getTime()** + ".jpg");
iimg.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(phoneFile));
Log.d("TAG", phoneFile + "");
c_img = (ImageView) findViewById(R.id.c_img);
Bitmap *bitmap* = BitmapFactory.decodeFile(*phoneFile*
.getAbsolutePath());
c_img.setImageBitmap(*bitmap*);
Intent video = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
*videoFile* = new File(Environment.getExternalStorageDirectory()
.getAbsoluteFile() + "/" + getTime() + ".mp4");
video.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(videoFile));
Log.d("TAG", *videoFile* + "");
v_video = (VideoView) findViewById(R.id.c_video);
v_video.setVideoURI(Uri.fromFile(videoFile));
v_video.start();
private String **getTime()** {
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
Date date = new Date();
String str = format.format(date);
return str;
}