Questions tagged [rx-java2]

anything related to RxJava2 – The new implementation of the RxJava Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.

RxJava2 is the new implementation of the RxJava Reactive Extensions for the JVM – RxJava2 is a library for composing asynchronous and event-based programs using observable sequences for the Java VM.

It extends the observer pattern to support sequences of data/events and adds operators that allow you to compose sequences together declaratively while abstracting away concerns about things like low-level threading, synchronization, thread-safety and concurrent data structures.

4140 questions
1
vote
2 answers

How to be able to get multiple response in RxJava?

I have this code below and I want to know how to be able to get additional response other than the set Boolean value: public Single uploadFile(String entityType, String entityId, String blobName){ return Single.create(e -> { …
quarks
  • 33,478
  • 73
  • 290
  • 513
1
vote
1 answer

RxJava flatMap with toList

can somebody explain me how to pass onComplete signal over flatMap operator in RxJava? If flatMap operator is commented I can get list of numbers from 1 to 10 it means toList will receive onComplete signal. But when I want to process data further in…
elementstyle
  • 1,021
  • 1
  • 10
  • 17
1
vote
0 answers

UndeliverableException when disposing and onError happen "simultaneously"

I am using the following snippet (in RxJava2) for retrieving a list of URL (from the network), and use each URL for downloading a file. The imageService.download() will run with a max concurrency value of…
GVillani82
  • 17,196
  • 30
  • 105
  • 172
1
vote
1 answer

onNext of the Subscribe method not emitting items after using the ZIP WITH operator in RxJava?

Main POJO: class VideoResponse{ List videosFiles; } I have the following case where i combine the results from two database operation and return as Observable(List(VideoResponse)) . ##Update## mDbHelper ===/* getVideoCategory()…
robin_24
  • 109
  • 2
  • 9
1
vote
1 answer

Error while trying to fetch data from Internet without Wifi connection using RxJava and Kotlin

Hello guys I have in my BaseActivity the following function. override fun subscribeToInternet(observable: Observable>>, observer: Observer>) { observable.subscribeOn(Schedulers.io()) …
Taha Malas
  • 23
  • 4
1
vote
1 answer

Sign-in flow with Jetpack Navigation and RxJava + Dagger2

TL;DR Considering the new recommendations regarding Launcher Screen and start destination navigation, how should we elegantly integrate the sign-in logic in an Android app, using Jetpack Navigation and RxJava? Following the Principles of…
w00ly
  • 455
  • 1
  • 5
  • 18
1
vote
2 answers

Rxjava of onBack double pressed to finish the activity

I want to implement a rxjava way of onback double press So, I refer to this answer since it seems reasonable but it does not work It show a toast and exit My code implementation for observe the double back is: private static final long EXIT_TIMEOUT…
Ali Habbash
  • 777
  • 2
  • 6
  • 29
1
vote
1 answer

PublishSubject blockingLast() hangs Android app and not invoke

I have a problem with getting the last emitted value from the Subject This is my class which is responsible for emitting and observing the battery changes: class BatteryLevelProvider @Inject constructor( app: App ) { private val context: Context =…
K.Os
  • 5,123
  • 8
  • 40
  • 95
1
vote
0 answers

Multiple Flowable with FlowableEmitter

I'm creating a WebSocket class to receive some data and I'm trying to use Flowable with FlowableEmitter to receive the socket response. I want to hold the emitter and every time I receive the data I call onNext and handle the result, it work fine if…
tiagoMissiato
  • 305
  • 3
  • 16
1
vote
0 answers

RxJava - flatMap on the same thread

I have nested items in my database like e.g. house - rooms. If I delete a house I also want to delete all rooms, but I do not want to think about this, so the house must know this. So my setup would look something like this: fun deleteHouse(item:…
prom85
  • 16,896
  • 17
  • 122
  • 242
1
vote
0 answers

android observer does not work after postvalue

I'm trying to get the data in the observe, but it doesn't work because the data doesn't arrive after the "postvalue" method is triggered in subscribe. What am I doing wrong? in fragment private fun initMapRoutes(mapRoutes: RecyclerView) { val m1…
Nikitc
  • 795
  • 1
  • 6
  • 12
1
vote
1 answer

Periodic WorkManager doesn't wait for image download completion to set wallpaper

I'm using Periodic WorkManager but update wallpaper after every x minutes automatically. But the issue that I'm facing is that when 'downloadWallpaper' method is called to download the image, it meanwhile proceeds to next method 'setWallpaper'…
Usman Rana
  • 2,067
  • 1
  • 21
  • 32
1
vote
1 answer

RxJava2: Perform operation on data which was successfully send to REST api

I have this specific issue for which I cannot find a clean solution. Observable.interval(1, TimeUnit.SECONDS) .flatMap { constructData() } .subscribe { data -> api.syncData(data) .repeat() .subscribe {…
Ernest Zamelczyk
  • 2,562
  • 2
  • 18
  • 32
1
vote
3 answers

Testing presenter who contains CompositeDisposable

I tried to create unit test for my presenter class which using RxJava CompositeDisposable but it always gave a null pointer exception. This is my presenter class: class LastMatchPresenter(val mView : MatchContract.View, val…
mangkool
  • 316
  • 2
  • 18
1
vote
2 answers

RxJava2 how to unsubscribe from outdated results properly

For those guys who are experienced in RxJava2 I have a question. Here is my method (code simplified): public void getRows(){ /*ui clear*/ helper.getObservable(argumentRowsDependOn) .subscribeOn(Schedulers.io()) …
hornet2319
  • 379
  • 3
  • 15