android采用 Luban 进行图片压缩

 Luban.get(this).load(file).putGear(Luban.THIRD_GEAR).setCompressListener(new OnCompressListener() {
                @Override
                public void onStart() {
                    showLoading();
                }

                @Override
                public void onSuccess(File file) {
                    System.out.println("压缩成功");
                    upLoadImage(file);
                }

                @Override
                public void onError(Throwable e) {
                    showLoadingSuccess();
                    ToastUtil.showToast(PersonalInformationActivity.this,"图片错误",0);
                }
            }).launch();

猜你喜欢

转载自blog.csdn.net/y2653904/article/details/72852852