调试器不会在 RxJava for Android 中的断点处停止

Alg*_*gar 9 debugging android android-studio rx-java rx-android

下面块中的Log.d(...)表达式catch(...)被执行(我可以在 Android Studio 中看到日志输出),但调试器不会在同一行设置的断点处停止。这是为什么?调试器在其他断点处停止。

Observable.create(new Observable.OnSubscribe<MobileBankIdSessionResponse.MobileBankIdSession>() {
       @Override
       public void call(final Subscriber<? super MobileBankIdSessionResponse.MobileBankIdSession> subscriber) {
           Schedulers.newThread().createWorker().schedule(new Action0() {
               @Override
               public void call() {
                   try {
                       MobileBankIdSessionResponse r = User.getMobileBankIdSession(reference, nationalIdentity).toBlocking().first();
                       String progressCode = r.getResponse().progress.progressCode;
                       if (StringUtils.equals(progressCode, "COMPLETE")) {
                           subscriber.onNext(r.getResponse());
                           subscriber.onCompleted();
                       } else if (StringUtils.equals(progressCode, "USER_SIGN")
                               || StringUtils.equals(progressCode, "OUTSTANDING_TRANSACTION")) {
                           Schedulers.newThread().createWorker().schedule(this, 2, TimeUnit.SECONDS);
                       } else if (StringUtils.equals(progressCode, "NO_CLIENT")) {
                           subscriber.onError(new Throwable("Fel vid signering"));
                       }
                   } catch (Exception e) {
                       Log.d("AtError", "here");
                       subscriber.onError(e);
                   }
               }
           });
       }
   }).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<MobileBankIdSessionResponse.MobileBankIdSession>() {
       @Override
       public void onCompleted() {}

       @Override
       public void onError(Throwable throwable) {
           mUserLoggedInOutSubject.onNext(Pair.create(throwable.getMessage(), LoginStates.ERROR));
       }

       @Override
       public void onNext(MobileBankIdSessionResponse.MobileBankIdSession mobileBankIdSession) {
           setSession(mobileBankIdSession.session, nationalIdentity);
       }
   });
Run Code Online (Sandbox Code Playgroud)

小智 0

对于来这里寻求答案的任何人,您可能还没有调用.subscribe(e ->{});您正在使用的 Single 、Flowable 等对象。