标签:
private final View.OnClickListener onClickListener = new View.OnClickListener() { @Override public void onClick(View v) { if(v==btnPhone){ //从相册获取图片 Intent intent = new Intent(Intent.ACTION_PICK, null); intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, IMAGE_UNSPECIFIED); startActivityForResult(intent, PHOTO_ZOOM); }else if(v==btnTakePicture){ //从拍照获取图片 Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile( new File(Environment .getExternalStorageDirectory(),"temp.jpg"))); startActivityForResult(intent, PHOTO_GRAPH); } } };
关于startActivityForResult()方法后Activity直接退出的问题原因和解决办法
标签:
原文地址:http://blog.csdn.net/u013224148/article/details/45722257