我想使用 rxjava Observable 在 Retrofit 中处理分页。我听从了另一个问题的建议。
我有 100 多个页面需要获取,但链在第 20 页左右失败,并停止对可观察对象的任何进一步订阅,并在 logcat 中使用以下日志
04-04 04:12:11.766 2951-3012/com.example.app I/dalvikvm﹕ threadid=28: stack overflow on call to Ljava/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater;.compareAndSet:ZLJJ
04-04 04:12:11.766 2951-3012/com.example.app I/dalvikvm﹕ method requires 56+20+32=108 bytes, fp is 0x94b52350 (80 left)
04-04 04:12:11.766 2951-3012/com.example.app I/dalvikvm﹕ expanding stack end (0x94b52300 to 0x94b52000)
04-04 04:12:11.766 2951-3012/com.example.app I/dalvikvm﹕ Shrank stack (to 0x94b52300, curFrame is 0x94b548dc)
有谁知道为什么会发生这种情况?
更新:我知道这是由于递归而发生的,但是有没有更优雅的方式来处理使用改造和 rxjava 的分页?