public void startTwoObservable(View v) { RetainFactory.start( getFragmentManager(), initReadyToUserObservable(-11, -1), null, "NEGATIVE_PRINTER") .subscribe(buildPrintAction()); RetainFactory.start( getFragmentManager(), initReadyToUserObservable(0, 10), null, "POSITIVE_PRINTER") .subscribe(buildPrintAction()); }
private void restartObservable(int count, String tag) { Observable<Integer> observable = initReadyToUserObservable(count); RetainFactory.restart(getFragmentManager(), observable, null, tag) .subscribe( buildPrintAction(), new Action1<Throwable>() { @Override public void call(Throwable throwable) {} }, new Action0() { @Override public void call() {} }); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mRotateExample = RetainFactory.create( getFragmentManager(), initReadyToUserObservable(10), new EmptySubscriber<Integer>() { @Override public void onNext(Integer integer) { printInt(integer); } }, "ROTATION_PRINTER"); }
private void startObservable(int count) { final String tag = "RESUMABLE_PRINTER"; Observable<Integer> observable = initReadyToUserObservable(count) .doOnError( new Action1<Throwable>() { @Override public void call(Throwable throwable) { restartObservable(11, tag); } }); RetainFactory.start(getFragmentManager(), observable, null, tag) .subscribe( buildPrintAction(), new Action1<Throwable>() { @Override public void call(Throwable throwable) {} }, new Action0() { @Override public void call() {} }); }
public void restartObservable(View v) { RetainFactory.restart(getFragmentManager(), initReadyToUserObservable(-10, 0), null) .subscribe(buildPrintAction()); }
public void simpleRun(View v) { RetainFactory.start(getFragmentManager(), initReadyToUserObservable(10), null) .subscribe(buildPrintAction()); }