一,简单的一个类帮你搞定头像上传+裁切
(1)这是一个PhotoPresenter类直接封装好了
/**
*
* <p>
* TODO(拍照或选择照片实现类)
* </p>
* <br/>
*/
public class PhotoPresenter {
public static final int CANCEL_PHOTO_ACTION=0;
public static final int TAKE_PHOTO_ACTION = 1;
public static final int SELECT_PHOTO_ACTION = 2;
public static final int CUT_PHOTO_ACTION = 3;
private Context mContext;
private String mImagePath;
private ImageView mImage;
public PhotoPresenter(Context context, ImageView image) {
mContext = context;
mImagePath = 图片本地存储路径;//自己设置
mImage = image;
}
/**
*
* <p>
* TODO(用相机拍照)
* </p>
* <br/>
*/
public void takePhoto() {
// 用相机拍照
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.p