Posts

Showing posts with the label rx-android

onNext of a created Observable does not work

Image
Clash Royale CLAN TAG #URR8PPP onNext of a created Observable does not work I am learning how to use Observable.create(). so i created the below posted example. but when I run the App. and click the button the log statement in the onNext is never displayed. and i receive the following message: The application may be doing too much work on its main thread. please let me know how to do it the corret way. code : Observable.create(emitter -> { btnStart.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { emitter.onNext(Log.i(TAG, "i: " + i[0]++)); } }); }); How do you consume this Observable ? The code shown barely does anything so it is unlikely you get the warning for this piece of code. – akarnokd 44 secs ago Observable ...