Search in sources :

Example 1 with RxPermissions

use of com.tbruyelle.rxpermissions2.RxPermissions in project BigImageViewer by Piasy.

the class LongImageActivity method saveImage.

@SuppressWarnings("MissingPermission")
private void saveImage() {
    disposePermissionRequest();
    mPermissionRequest = new RxPermissions(this).request(Manifest.permission.WRITE_EXTERNAL_STORAGE).subscribe(new Consumer<Boolean>() {

        @Override
        public void accept(Boolean granted) throws Exception {
            if (granted) {
                mBigImageView.saveImageIntoGallery();
            }
        }
    }, new Consumer<Throwable>() {

        @Override
        public void accept(Throwable throwable) throws Exception {
            throwable.printStackTrace();
        }
    });
}
Also used : RxPermissions(com.tbruyelle.rxpermissions2.RxPermissions) Consumer(io.reactivex.functions.Consumer)

Aggregations

RxPermissions (com.tbruyelle.rxpermissions2.RxPermissions)1 Consumer (io.reactivex.functions.Consumer)1