From 6d6a0d3cffccaf05a48a79d3bfafc2e3ca7551b6 Mon Sep 17 00:00:00 2001 From: tianxiangyu <96164429+FlyJingFish@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:32:07 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=AE=8C=E5=96=84=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/zh/android_aop_extra.md | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/docs/zh/android_aop_extra.md b/docs/zh/android_aop_extra.md index 1a477a36..2b55c103 100644 --- a/docs/zh/android_aop_extra.md +++ b/docs/zh/android_aop_extra.md @@ -79,22 +79,10 @@ AndroidAop.INSTANCE.setOnThrowableListener(new OnThrowableListener() { String[] permissions = permission.value(); if (target instanceof FragmentActivity){ RxPermissions rxPermissions = new RxPermissions((FragmentActivity) target); - rxPermissions.requestEach(permissions) - .subscribe(permissionResult -> { - call.onCall(permissionResult.granted); - if (!permissionResult.granted && target instanceof PermissionRejectListener) { - ((PermissionRejectListener) target).onReject(permission,permissionResult); - } - }); + rxPermissions.request(permission.value()).subscribe(call::onCall); }else if (target instanceof Fragment){ RxPermissions rxPermissions = new RxPermissions((Fragment) target); - rxPermissions.requestEach(permissions) - .subscribe(permissionResult -> { - call.onCall(permissionResult.granted); - if (!permissionResult.granted && target instanceof PermissionRejectListener) { - ((PermissionRejectListener) target).onReject(permission,permissionResult); - } - }); + rxPermissions.request(permission.value()).subscribe(call::onCall); }else { // TODO: target 不是 FragmentActivity 或 Fragment ,说明注解所在方法不在其中,请自行处理这种情况 // 建议:切点方法第一个参数可以设置为 FragmentActivity 或 Fragment ,然后 joinPoint.args[0] 就可以拿到