I am having a list of images which i wanted to download.So below is the code which i used:
Observable.fromIterable(imagelist).subscribeOn(Scheduler.io). subscribe {
//download logic
}.addtodisposible(compositedisposible)
Initially, all downloaded images are saved into folder A. Now I have written a condition inside this iteration. if that condition satisfies, it should break the loop and call the same function again with only remaining items that are left to be iterated/downloaded and store it in folder B. Note:-1-> I tried to use takeuntil and added a Boolean value which i turn true if that condition satisfies.but iteration doesn't stop. 2-> if i clear composite disposible, the iteration stops and iteration with new items also begins, but iterates only few items.
Please help. Thank you.