Closed ckenergy closed 7 years ago
之前用5.0没错
我真机4.3也报同样错误,6.0正常
It's because of device below 5.0 when use "include" tag in layout.xml file bind the ViewModel will call this method when itemView not ready. issues:https://code.google.com/p/android/issues/detail?id=220801
Now I have remove all code where use "include" tag in layout, and it seem to work fine!
07-04 09:39:01.743 995-995/com.kelin.mvvmlight.zhihu E/AndroidRuntime: FATAL EXCEPTION: main java.lang.IllegalStateException: Exception thrown on Scheduler.Worker thread. Add
onError
handling. at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:60) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4745) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method) Caused by: rx.exceptions.OnErrorNotImplementedException at rx.Observable$27.onError(Observable.java:8139) at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:157) at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:120) at rx.internal.operators.OperatorToObservableList$1.onError(OperatorToObservableList.java:99) at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:71) at rx.exceptions.Exceptions.throwOrReport(Exceptions.java:189) at rx.internal.operators.OperatorDoOnEach$1.onNext(OperatorDoOnEach.java:82) at rx.internal.operators.OperatorMerge$MergeSubscriber.emitScalar(OperatorMerge.java:368) at rx.internal.operators.OperatorMerge$MergeSubscriber.tryEmit(OperatorMerge.java:330) at rx.internal.operators.OperatorMerge$InnerSubscriber.onNext(OperatorMerge.java:807) at rx.internal.operators.OnSubscribeFromIterable$IterableProducer.slowpath(OnSubscribeFromIterable.java:97) at rx.internal.operators.OnSubscribeFromIterable$IterableProducer.request(OnSubscribeFromIterable.java:73) at rx.Subscriber.setProducer(Subscriber.java:211) at rx.internal.operators.OnSubscribeFromIterable.call(OnSubscribeFromIterable.java:49) at rx.internal.operators.OnSubscribeFromIterable.call(OnSubscribeFromIterable.java:32) at rx.Observable.unsafeSubscribe(Observable.java:8314) at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:235) at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:145) at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:54) at rx.internal.operators.OperatorDoOnEach$1.onNext(OperatorDoOnEach.java:85) at rx.internal.util.ScalarSynchronousObservable$WeakSingleProducer.request(ScalarSynchronousObservable.java:274) at rx.Subscriber.setProducer(Subscriber.java:211) at rx.Subscriber.setProducer(Subscriber.java:205) at rx.Subscriber.setProducer(Subscriber.java:205) at rx.internal.util.ScalarSynchronousObservable$2.call(ScalarSynchronousObservable.java:93) at rx.internal.util.ScalarSynchronousObservable$2.call(ScalarSynchronousObservable.java:89) at rx.Observable$2.call(Observable.java:162) at rx.Observable$2.call(Observable.java:154) at rx.Observable$2.call(Observable.java:162) at rx.Observable$2.call(Observable.java:154) at rx.Observable$2.call(Observable.java:162) at rx.Observable$2.call(Observable.java:154) at rx.Observable$2.call(Observable.java:162) at rx.Observable$2.call(Observable.java:154) at rx.Observable$2.call(Observable.java:162) at rx.Observable$2.call(Observable.java:154) at rx.Observable.subscribe(Observable.java:8407) at rx.Observable.subscribe(Observable.java:8374) at rx.Observable.subscribe(Observable.java:8130) at com.kelin.mvvmlight.zhihu.MainViewModel.lambda$new$4(MainViewModel.java:41) at com.kelin.mvvmlight.zhihu.MainViewModel.access$lambda$0(MainViewModel.java) at com.kelin.mvvmlight.zhihu.MainViewModel$$Lambda$1.call(Unknown Source) at com.kelin.mvvmlight.messenger.WeakAction.execute(WeakAction.java:38) at com.kelin.mvvmlight.messenger.Messenger.sendToList(Messenger.java:309) at com.kelin.mvvmlight.messenger.Messenger.sendToTargetOrType(Messenger.java:572) at com.kelin.mvvmlight.messenger.Messenger.send(Messenger.java:252) at com.kelin.mvvmlight.zhihu.news.NewsViewModel.lambda$loadTopNews$26(NewsViewModel.java:159) at