[Android 知识点] RxAndroid的使用(五)(待更新)
2017-01-06 18:34
274 查看
Error Handling Operators 错误处理
Catch — recover from an onError notification by continuing the sequence without errorRetry — if a source Observable sends an onError notification, resubscribe to it in the hopes that it will complete without error
Observable Utility Operators 通用操作
Delay — shift the emissions from an Observable forward in time by a particular amountDo — register an action to take upon a variety of Observable lifecycle events
Materialize/Dematerialize — represent both the items emitted and the notifications sent as emitted items, or reverse this process
ObserveOn — specify the scheduler on which an observer will observe this Observable
Serialize — force an Observable to make serialized calls and to be well-behaved
Subscribe — operate upon the emissions and notifications from an Observable
SubscribeOn — specify the scheduler an Observable should use when it is subscribed to
TimeInterval — convert an Observable that emits items into one that emits indications of the amount of time elapsed between those emissions
Timeout — mirror the source Observable, but issue an error notification if a particular period of time elapses without any emitted items
Timestamp — attach a timestamp to each item emitted by an Observable
Using — create a disposable resource that has the same lifespan as the Observable
subscribeOn(Schedulers.io())
subscribeOn会修改我们刚刚创建的Observable。在默认情况下Observable的所有代码,包括刚才说到的只有在被订阅之后才会执行的代码,都会在执行subscribe()方法的线程中运行。而通过subscribeOn()方法,这些代码可以在其他线程中执行。observeOn(AndroidSchedulers.mainThread())
告诉RxJava我们要在UI线程中观察这个Observable相关文章推荐
- [Android 知识点] RxAndroid的使用(六)(待更新)
- [Android 知识点] RxAndroid的使用(四)(待更新)
- [Android 知识点] RxAndroid的使用(七)(待更新)
- [Android 知识点] RxAndroid的使用(一)
- [Android 知识点] RxAndroid的使用(三)
- 使用RxAndroid配合MVP模式实现异步网络请求,更新ui
- [Android 知识点] RxAndroid的使用(二)
- Android异步处理一:使用Thread+Handler实现非UI线程更新UI界面
- Android的线程使用来更新UI----Thread、Handler、Looper、TimerTask等
- Android的消息机制,用Android线程间通信的Message机制,Android中Handler的使用方法——在子线程中更新界面,handler机制
- Android的线程使用来更新UI----Thread、Handler、Looper、TimerTask等
- Android的线程使用来更新UI----Thread、Handler、Looper、TimerTask等
- Android异步处理一:使用Thread+Handler实现非UI线程更新UI界面
- Android中Handler的使用方法——在子线程中更新界面
- Android的消息机制,用Android线程间通信的Message机制,Android中Handler的使用方法——在子线程中更新界面,handler机制
- Android中Handler的使用方法——在子线程中更新界面
- Android的消息机制,用Android线程间通信的Message机制,Android中Handler的使用方法——在子线程中更新界面,handler机制
- Android Jni中使用线程及回调更新UI
- android解决:使用多线程和Handler同步更新UI
- 【摘录】Android的线程使用来更新UI----Thread、Handler、Looper、TimerTask等