GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add button 3 example where you start immediately and then go on… · klmpois/Android-RxJava@4feeb5f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • app/src/main/java/com/morihacky/android/rxjava
    • TimingDemoFragment.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎app/src/main/java/com/morihacky/android/rxjava/TimingDemoFragment.java‎

Copy file name to clipboardExpand all lines: app/src/main/java/com/morihacky/android/rxjava/TimingDemoFragment.java
+30Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,36 @@ public void onNext(Long number) {
106106
});
107107
}
108108

109+
@OnClick(R.id.btn_demo_timing_3)
110+
public void Btn3_RunTask_IntervalOf1s_StartImmediately() {
111+
if (_subscription2 != null && !_subscription2.isUnsubscribed()) {
112+
_subscription2.unsubscribe();
113+
_log(String.format("C3 [%s] XXX BTN KILLED", _getCurrentTimestamp()));
114+
return;
115+
}
116+
117+
_log(String.format("C3 [%s] --- BTN click", _getCurrentTimestamp()));
118+
119+
_subscription2 = Observable//
120+
.timer(0, 1, TimeUnit.SECONDS)//
121+
.subscribe(new Observer<Long>() {
122+
@Override
123+
public void onCompleted() {
124+
_log(String.format("C3 [%s] XXXX COMPLETE", _getCurrentTimestamp()));
125+
}
126+
127+
@Override
128+
public void onError(Throwable e) {
129+
Timber.e(e, "something went wrong in TimingDemoFragment example");
130+
}
131+
132+
@Override
133+
public void onNext(Long number) {
134+
_log(String.format("C3 [%s] NEXT", _getCurrentTimestamp()));
135+
}
136+
});
137+
}
138+
109139
@OnClick(R.id.btn_demo_timing_4)
110140
public void Btn4_RunTask5Times_IntervalOf3s() {
111141
_log(String.format("D4 [%s] --- BTN click", _getCurrentTimestamp()));

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.