Saturday 6 January 2018

Temp 2 - Realm



1. Creating Observable

--------------------------------------------------
Observable.<String>create(s ->{
s.onNext("I created succesfully");
s.onComplete();
});
--------------------------------------------------


2. Creating Observable and do some work

--------------------------------------------------
Observable.<String>create(s ->{

            String calc1 = doSomething();
            s.onNext(calc1);
         
            String calc2 = doSomeOtherthing();
            s.onNext(calc2);
         
         
            s.onComplete();
        });

--------------------------------------------------

3. Map

----------------------------------------
Observable.just(1,2,3,4)
.map(x -> x+" text")   or   .map(x -> x+1)
.subscribe(System.out::println);
----------------------------------------



















22

No comments:

Post a Comment

Calling method Sequencely

1. Execute multiple task sequencly (WAY-1) ------------------------------------------------------------------------------ import io.re...