标签:
//系统相册请求码 private final static int REQUESTCODE_GALLERY = 100; //系统相机请求码 private final static int REQUESTCODE_CAMERA = 101;
//拍照图片保存地址
private final static String HEADER_PATH = Environment.getExternalStorageDirectory() + File.separator + "header.jpg";
//进入系统相册 Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("image/*"); startActivityForResult(intent, REQUESTCODE_GALLERY);
//进入相机 Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
//把拍照生成图片的路径传过去 Uri uri = getUriFormFile(HEADER_PATH); intent.putExtra(MediaStore.EXTRA_OUTPUT, uri); startActivityForResult(intent, REQUESTCODE_CAMERA);
标签:
原文地址:http://www.cnblogs.com/niupi/p/5606376.html