当前位置: 首页>>代码示例>>Java>>正文


Java RxErrorHandler类代码示例

本文整理汇总了Java中me.jessyan.rxerrorhandler.core.RxErrorHandler的典型用法代码示例。如果您正苦于以下问题:Java RxErrorHandler类的具体用法?Java RxErrorHandler怎么用?Java RxErrorHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RxErrorHandler类属于me.jessyan.rxerrorhandler.core包,在下文中一共展示了RxErrorHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: callPhone

import me.jessyan.rxerrorhandler.core.RxErrorHandler; //导入依赖的package包/类
/**
     * 请求打电话权限
     */
    public static void callPhone(final RequestPermission requestPermission, RxPermissions rxPermissions, final BaseView view, RxErrorHandler errorHandler) {
//先确保是否已经申请过权限
        boolean isPermissionsGranted =
                rxPermissions
                        .isGranted(Manifest.permission.CALL_PHONE);

        if (isPermissionsGranted) {//已经申请过,直接执行操作
            requestPermission.onRequestPermissionSuccess();
        } else {//没有申请过,则申请
            rxPermissions
                    .request(Manifest.permission.CALL_PHONE)
                    .compose(PermissionUtil.<Boolean>bindToLifecycle(view))//使用RXlifecycle,使subscription和activity一起销毁
                    .subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
                        @Override
                        public void onNext(Boolean granted) {
                            if (granted) {
                                Timber.tag(TAG).d("request SEND_SMS success");
                                requestPermission.onRequestPermissionSuccess();
                            } else {
                                view.showMessage("request permissons failure");
                            }
                        }
                    });
        }
    }
 
开发者ID:Zyj163,项目名称:yyox,代码行数:29,代码来源:PermissionUtil.java

示例2: externalStorage

import me.jessyan.rxerrorhandler.core.RxErrorHandler; //导入依赖的package包/类
/**
 * 请求外部存储的权限
 */
public static void externalStorage(final RequestPermission requestPermission, RxPermissions rxPermissions, final BaseView view, RxErrorHandler errorHandler) {
    //先确保是否已经申请过摄像头,和写入外部存储的权限
    boolean isPermissionsGranted =
            rxPermissions
                    .isGranted(Manifest.permission.WRITE_EXTERNAL_STORAGE);

    if (isPermissionsGranted) {//已经申请过,直接执行操作
        requestPermission.onRequestPermissionSuccess();
    } else {//没有申请过,则申请
        rxPermissions
                .request(Manifest.permission.WRITE_EXTERNAL_STORAGE)
                .subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
                    @Override
                    public void onNext(Boolean granted) {
                        if (granted) {
                            Timber.tag(TAG).d("request WRITE_EXTERNAL_STORAGE and CAMERA success");
                            requestPermission.onRequestPermissionSuccess();
                        } else {
                            view.showMessage("request permissons failure");
                        }
                    }
                });
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:PermissionUtil.java

示例3: sendSms

import me.jessyan.rxerrorhandler.core.RxErrorHandler; //导入依赖的package包/类
/**
     * 请求发送短信权限
     */
    public static void sendSms(final RequestPermission requestPermission, RxPermissions rxPermissions, final BaseView view, RxErrorHandler errorHandler) {
//先确保是否已经申请过权限
        boolean isPermissionsGranted =
                rxPermissions
                        .isGranted(Manifest.permission.SEND_SMS);

        if (isPermissionsGranted) {//已经申请过,直接执行操作
            requestPermission.onRequestPermissionSuccess();
        } else {//没有申请过,则申请
            rxPermissions
                    .request(Manifest.permission.SEND_SMS)
                    .subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
                        @Override
                        public void onNext(Boolean granted) {
                            if (granted) {
                                Timber.tag(TAG).d("request SEND_SMS success");
                                requestPermission.onRequestPermissionSuccess();
                            } else {
                                view.showMessage("request permissons failure");
                            }
                        }
                    });
        }
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:PermissionUtil.java

示例4: callPhone

import me.jessyan.rxerrorhandler.core.RxErrorHandler; //导入依赖的package包/类
/**
     * 请求打电话权限
     */
    public static void callPhone(final RequestPermission requestPermission, RxPermissions rxPermissions, final BaseView view, RxErrorHandler errorHandler) {
//先确保是否已经申请过权限
        boolean isPermissionsGranted =
                rxPermissions
                        .isGranted(Manifest.permission.CALL_PHONE);

        if (isPermissionsGranted) {//已经申请过,直接执行操作
            requestPermission.onRequestPermissionSuccess();
        } else {//没有申请过,则申请
            rxPermissions
                    .request(Manifest.permission.CALL_PHONE)
                    .subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
                        @Override
                        public void onNext(Boolean granted) {
                            if (granted) {
                                Timber.tag(TAG).d("request SEND_SMS success");
                                requestPermission.onRequestPermissionSuccess();
                            } else {
                                view.showMessage("request permissons failure");
                            }
                        }
                    });
        }
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:PermissionUtil.java

示例5: readPhonestate

import me.jessyan.rxerrorhandler.core.RxErrorHandler; //导入依赖的package包/类
/**
     * 请求获取手机状态的权限
     */
    public static void readPhonestate(final RequestPermission requestPermission, RxPermissions rxPermissions, RxErrorHandler errorHandler) {
//先确保是否已经申请过权限
        boolean isPermissionsGranted =
                rxPermissions
                        .isGranted(Manifest.permission.READ_PHONE_STATE);

        if (isPermissionsGranted) {//已经申请过,直接执行操作
            requestPermission.onRequestPermissionSuccess();
        } else {//没有申请过,则申请
            rxPermissions
                    .request(Manifest.permission.READ_PHONE_STATE)
                    .subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
                        @Override
                        public void onNext(Boolean granted) {
                            if (granted) {
                                Timber.tag(TAG).d("request SEND_SMS success");
                                requestPermission.onRequestPermissionSuccess();
                            } else {
                                Timber.tag(TAG).e("request permissons failure");
                            }
                        }
                    });
        }
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:PermissionUtil.java

示例6: externalStorage

import me.jessyan.rxerrorhandler.core.RxErrorHandler; //导入依赖的package包/类
/**
 * 请求外部存储的权限
 */
public static void externalStorage(final RequestPermission requestPermission, RxPermissions rxPermissions, final BaseView view, RxErrorHandler errorHandler) {
    //先确保是否已经申请过摄像头,和写入外部存储的权限
    boolean isPermissionsGranted =
            rxPermissions
                    .isGranted(Manifest.permission.WRITE_EXTERNAL_STORAGE);

    if (isPermissionsGranted) {//已经申请过,直接执行操作
        requestPermission.onRequestPermissionSuccess();
    } else {//没有申请过,则申请
        rxPermissions
                .request(Manifest.permission.WRITE_EXTERNAL_STORAGE)
                .compose(PermissionUtil.<Boolean>bindToLifecycle(view))//使用RXlifecycle,使subscription和activity一起销毁
                .subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
                    @Override
                    public void onNext(Boolean granted) {
                        if (granted) {
                            Timber.tag(TAG).d("request WRITE_EXTERNAL_STORAGE and CAMERA success");
                            requestPermission.onRequestPermissionSuccess();
                        } else {
                            view.showMessage("request permissons failure");
                        }
                    }
                });
    }
}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:29,代码来源:PermissionUtil.java

示例7: sendSms

import me.jessyan.rxerrorhandler.core.RxErrorHandler; //导入依赖的package包/类
/**
     * 请求发送短信权限
     */
    public static void sendSms(final RequestPermission requestPermission, RxPermissions rxPermissions, final BaseView view, RxErrorHandler errorHandler) {
//先确保是否已经申请过权限
        boolean isPermissionsGranted =
                rxPermissions
                        .isGranted(Manifest.permission.SEND_SMS);

        if (isPermissionsGranted) {//已经申请过,直接执行操作
            requestPermission.onRequestPermissionSuccess();
        } else {//没有申请过,则申请
            rxPermissions
                    .request(Manifest.permission.SEND_SMS)
                    .compose(PermissionUtil.<Boolean>bindToLifecycle(view))//使用RXlifecycle,使subscription和activity一起销毁
                    .subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
                        @Override
                        public void onNext(Boolean granted) {
                            if (granted) {
                                Timber.tag(TAG).d("request SEND_SMS success");
                                requestPermission.onRequestPermissionSuccess();
                            } else {
                                view.showMessage("request permissons failure");
                            }
                        }
                    });
        }
    }
 
开发者ID:Zyj163,项目名称:yyox,代码行数:29,代码来源:PermissionUtil.java

示例8: externalStorage

import me.jessyan.rxerrorhandler.core.RxErrorHandler; //导入依赖的package包/类
/**
 * 请求外部存储的权限
 */
public static void externalStorage(final RequestPermission requestPermission, RxPermissions rxPermissions, final IView view, RxErrorHandler errorHandler) {
    //先确保是否已经申请过摄像头,和写入外部存储的权限
    boolean isPermissionsGranted =
            rxPermissions
                    .isGranted(Manifest.permission.WRITE_EXTERNAL_STORAGE);

    if (isPermissionsGranted) {//已经申请过,直接执行操作
        requestPermission.onRequestPermissionSuccess();
    } else {//没有申请过,则申请
        rxPermissions
                .request(Manifest.permission.WRITE_EXTERNAL_STORAGE)
                .subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
                    @Override
                    public void onNext(Boolean granted) {
                        if (granted) {
                            Timber.tag(TAG).d("request WRITE_EXTERNAL_STORAGE and CAMERA success");
                            requestPermission.onRequestPermissionSuccess();
                        } else {
                            view.showMessage("request permissons failure");
                        }
                    }
                });
    }
}
 
开发者ID:hshare,项目名称:MVPArmsTest1,代码行数:28,代码来源:PermissionUtil.java

示例9: callPhone

import me.jessyan.rxerrorhandler.core.RxErrorHandler; //导入依赖的package包/类
/**
     * 请求打电话权限
     */
    public static void callPhone(final RequestPermission requestPermission, RxPermissions rxPermissions, final IView view, RxErrorHandler errorHandler) {
//先确保是否已经申请过权限
        boolean isPermissionsGranted =
                rxPermissions
                        .isGranted(Manifest.permission.CALL_PHONE);

        if (isPermissionsGranted) {//已经申请过,直接执行操作
            requestPermission.onRequestPermissionSuccess();
        } else {//没有申请过,则申请
            rxPermissions
                    .request(Manifest.permission.CALL_PHONE)
                    .subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
                        @Override
                        public void onNext(Boolean granted) {
                            if (granted) {
                                Timber.tag(TAG).d("request SEND_SMS success");
                                requestPermission.onRequestPermissionSuccess();
                            } else {
                                view.showMessage("request permissons failure");
                            }
                        }
                    });
        }
    }
 
开发者ID:hshare,项目名称:MVPArmsTest1,代码行数:28,代码来源:PermissionUtil.java

示例10: externalStorage

import me.jessyan.rxerrorhandler.core.RxErrorHandler; //导入依赖的package包/类
/**
 * 请求外部存储的权限
 */
public static void externalStorage(final RequestPermission requestPermission, RxPermissions rxPermissions, final BaseView view, RxErrorHandler errorHandler) {
    //先确保是否已经申请过摄像头,和写入外部存储的权限
    boolean isPermissionsGranted =rxPermissions
                    .isGranted(Manifest.permission.WRITE_EXTERNAL_STORAGE);

    if (isPermissionsGranted) {//已经申请过,直接执行操作
        requestPermission.onRequestPermissionSuccess();
    } else {//没有申请过,则申请
        rxPermissions
                .request(Manifest.permission.WRITE_EXTERNAL_STORAGE)
                .subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
                    @Override
                    public void onNext(Boolean granted) {
                        if (granted) {
                            Timber.tag(TAG).d("request WRITE_EXTERNAL_STORAGE and CAMERA success");
                            requestPermission.onRequestPermissionSuccess();
                        } else {
                            view.showMessage("request permissons failure");
                        }
                    }
                });
    }
}
 
开发者ID:Wan7451,项目名称:mvparms,代码行数:27,代码来源:PermissionUtil.java

示例11: sendSms

import me.jessyan.rxerrorhandler.core.RxErrorHandler; //导入依赖的package包/类
/**
     * 请求发送短信权限
     */
    public static void sendSms(final RequestPermission requestPermission, RxPermissions rxPermissions, final IView view, RxErrorHandler errorHandler) {
//先确保是否已经申请过权限
        boolean isPermissionsGranted =
                rxPermissions
                        .isGranted(Manifest.permission.SEND_SMS);

        if (isPermissionsGranted) {//已经申请过,直接执行操作
            requestPermission.onRequestPermissionSuccess();
        } else {//没有申请过,则申请
            rxPermissions
                    .request(Manifest.permission.SEND_SMS)
                    .subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
                        @Override
                        public void onNext(Boolean granted) {
                            if (granted) {
                                Timber.tag(TAG).d("request SEND_SMS success");
                                requestPermission.onRequestPermissionSuccess();
                            } else {
                                view.showMessage("request permissons failure");
                            }
                        }
                    });
        }
    }
 
开发者ID:hshare,项目名称:MVPArmsTest1,代码行数:28,代码来源:PermissionUtil.java

示例12: launchCamera

import me.jessyan.rxerrorhandler.core.RxErrorHandler; //导入依赖的package包/类
/**
 * 请求摄像头权限
 */
public static void launchCamera(final RequestPermission requestPermission, RxPermissions rxPermissions, final BaseView view, RxErrorHandler errorHandler) {
    //先确保是否已经申请过摄像头,和写入外部存储的权限
    boolean isPermissionsGranted =
            rxPermissions
                    .isGranted(Manifest.permission.WRITE_EXTERNAL_STORAGE) &&
                    rxPermissions
                            .isGranted(Manifest.permission.CAMERA);

    if (isPermissionsGranted) {//已经申请过,直接执行操作
        requestPermission.onRequestPermissionSuccess();
    } else {//没有申请过,则申请
        rxPermissions
                .request(Manifest.permission.WRITE_EXTERNAL_STORAGE
                        , Manifest.permission.CAMERA)
                .subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
                    @Override
                    public void onNext(Boolean granted) {
                        if (granted) {
                            Timber.tag(TAG).d("request WRITE_EXTERNAL_STORAGE and CAMERA success");
                            requestPermission.onRequestPermissionSuccess();
                        } else {
                            view.showMessage("request permissons failure");
                        }
                    }
                });
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:31,代码来源:PermissionUtil.java

示例13: proRxErrorHandler

import me.jessyan.rxerrorhandler.core.RxErrorHandler; //导入依赖的package包/类
/**
 * 提供处理Rxjava错误的管理器
 *
 * @return
 */
@Singleton
@Provides
RxErrorHandler proRxErrorHandler(Application application, ResponseErroListener listener) {
    return RxErrorHandler
            .builder()
            .with(application)
            .responseErroListener(listener)
            .build();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:ClientModule.java

示例14: UserPresenter

import me.jessyan.rxerrorhandler.core.RxErrorHandler; //导入依赖的package包/类
@Inject
public UserPresenter(UserContract.Model model, UserContract.View rootView, RxErrorHandler handler
        , AppManager appManager, Application application) {
    super(model, rootView);
    this.mApplication = application;
    this.mErrorHandler = handler;
    this.mAppManager = appManager;
    mAdapter = new UserAdapter(mUsers);
    mRootView.setAdapter(mAdapter);//设置Adapter
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:UserPresenter.java

示例15: launchCamera

import me.jessyan.rxerrorhandler.core.RxErrorHandler; //导入依赖的package包/类
/**
 * 请求摄像头权限
 */
public static void launchCamera(final RequestPermission requestPermission, RxPermissions rxPermissions, final BaseView view, RxErrorHandler errorHandler) {
    //先确保是否已经申请过摄像头,和写入外部存储的权限
    boolean isPermissionsGranted =
            rxPermissions
                    .isGranted(Manifest.permission.WRITE_EXTERNAL_STORAGE) &&
                    rxPermissions
                            .isGranted(Manifest.permission.CAMERA);

    if (isPermissionsGranted) {//已经申请过,直接执行操作
        requestPermission.onRequestPermissionSuccess();
    } else {//没有申请过,则申请
        rxPermissions
                .request(Manifest.permission.WRITE_EXTERNAL_STORAGE
                        , Manifest.permission.CAMERA)
                .compose(PermissionUtil.<Boolean>bindToLifecycle(view))//使用RXlifecycle,使subscription和activity一起销毁
                .subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
                    @Override
                    public void onNext(Boolean granted) {
                        if (granted) {
                            Timber.tag(TAG).d("request WRITE_EXTERNAL_STORAGE and CAMERA success");
                            requestPermission.onRequestPermissionSuccess();
                        } else {
                            view.showMessage("request permissons failure");
                        }
                    }
                });
    }
}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:32,代码来源:PermissionUtil.java


注:本文中的me.jessyan.rxerrorhandler.core.RxErrorHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。