Slide 43
Slide 43 text
Creating Sources
Observable.fromCallable(new Callable() {
@Override
public String call() throws Exception {
return "Hello";
}
});
• Returns an Observable that, when an observer
subscribes to it, invokes a function you specify and
then emits the value returned from that function.
• 當有⼈人訂閱 (subscribe) 時,才發射資料。