Android通过Intent方式调用相机拍照取得图片
AndroidManifest.XML
权限设置:
XML布局设置:
代码:
public classMainActivityextendsAppCompatActivity implementsView.OnClickListener{
private static intREQUST_SUO=1;//获取缩略图信号标识
private static int REQUST_ORIGINAL=2;//获取原图信号标识
privateButtonbtn1;
private Buttonbtn2;
private ImageViewiv1;
private ImageViewiv2;
private StringsdPath;
private StringpicPath;
@Override
protected voidonCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
init();
}
private voidinit(){
btn1= ((Button) findV