rx-java2 Questions

3

I'm just learning RxJava 2 and I would like catch exceptions only of a specific type and return an Observable. Essentially, I want onErrorResumeNext() to only catch a specific exception class, but ...
Mattie asked 21/2, 2017 at 15:44

1

Solved

I have a RecyclerView adapter with DiffUtil functionality. I wanted to use DataObserver to notify fragment when DiffUtil finishes its magic. However, looks like DiffUtil doesn't call the observers....
Appoggiatura asked 16/5, 2018 at 12:33

1

Solved

I have a getPlaces method in my repository: override fun getPlaces(filter: FilterRequest): Flowable<List<Place>> { return from(placesApi.filter(filter)) .doOnSuccess { placesDao.sav...
Yell asked 12/6, 2018 at 13:21

5

Question : Can I implement android app with MVVM without using Databinding. Problem I am trying to solve is pretty simple: read a list of items from backend API and show them in a Recylerview. Ho...
Inkberry asked 17/1, 2018 at 3:7

3

Solved

I have a rest api that returns a list of places, which have a list of categories: { "id": "35fds-45sdgk-fsd87", "name" : "My awesome place", "categories" : [ { "id": "cat1", "name" : "Catego...
Horbal asked 11/6, 2018 at 13:49

1

Solved

I'm trying to replace EventBus with RxAndroid. I want pageable fragments to subscribe/unsubscribe to an event source, these fragments get created and discarded relatively quickly, depending on ho...
Auriferous asked 13/6, 2018 at 18:32

1

Solved

I'm working with an API of my own and a i'm hoping to chain a few paginated results using RxJava. I use cursor based pagination. (imagine there are 50 users in this first request): { "data":{ "s...
Conlen asked 12/6, 2018 at 23:8

1

Solved

In the following method, how do I pass the result of the first Single to the second Single? As it's written now, when it returns, somethingId is empty. If I change the value in the returned Single...
Vichyssoise asked 12/6, 2018 at 1:0

3

Solved

Let's say I have a event-emitting data source that I want to transform into reactive stream. Data source is bound by a resource (for example a socket that periodically sends updated state) so I wou...
Malissa asked 18/5, 2018 at 20:48

2

So I'm trying to integrate Firebase performance for Http requests and add them manually as they show here (step 9). I'm using Retrofit 2 and RxJava 2, so I had the idea of doing a custom operator,...
Azimuth asked 18/1, 2018 at 23:42

1

Solved

I'm trying to find an operator in RxJava that will throttle in a specific way: Emits an element For a set period after the element has been emitted, all other emitted elements are filtered out ...
Mendicant asked 23/5, 2018 at 3:21

1

I want to make two concurent request to Realm database and return results with RxJava. The issue is that one of requests can return NULL object and I have a crash. How can I properly return results...
Escalera asked 14/5, 2018 at 15:52

1

Solved

I want to zip a list of Observable<List<Int>>. fun testObservablezip() { val jobs = mutableListOf<Observable<List<Int>>>() for (i in 0 until 100 step 10) { val job...
Sava asked 19/5, 2018 at 9:2

3

Solved

I have a list List<FileModel> FileModel is just a class contains id: Int id - is ID of photo file I need to fetch and cast to Bitmap I have a request: fun getFile(fileId: Int): Single&lt...
Pharmacist asked 11/5, 2018 at 13:36

4

Solved

Trying to test new Android Room librarty with RxJava adapter. And I want to handle result if my query returns 0 objects from DB: So here is DAO method: @Query("SELECT * FROM auth_info") f...
Unintentional asked 27/5, 2017 at 10:0

1

I try to apply the MVVM pattern in my Android activity (I'm an Android noob). I use Room with RxJava 2, e.g. this is a signature of a method in my repository: public Single<MissionTask> get...
Domingo asked 4/5, 2018 at 10:41

2

Solved

Observable.create(new ObservableOnSubscribe()) .subscribeOn(Schedulers.io()) .compose(new ParserTransformer()) .map() .subscribe() When something wrong in my ObservableOnSubscribe, it throws ...
Mordy asked 26/4, 2018 at 7:19

1

Solved

I want to buffer elements and emit them as collection when there is no new element for x amount of time. how to do that? For example given input INPUT TIME 1 0 2 0 3 100 4 150 5 400 6 450 7 800 ...
Alcott asked 16/4, 2018 at 18:25

1

Solved

I'm having a scenario where I need to periodically call an API to check for a result. I'm using Flowable.interval to create an interval function which calls the API. However, I'm having trouble wi...
Malenamalet asked 13/4, 2018 at 6:23

1

Solved

Given an API (implemented by Retrofit) that returns a model. I wrap an old fashioned Call into a Deferred using the extention function: fun <T> Call<T>.toDeferred(): Deferred<T> ...
Kellyekellyn asked 10/4, 2018 at 20:11

2

Solved

I am using onErrorReturn to emit a particular item rather than invoking onError if the observable encounters an error: Observable<String> observable = getObservableSource(); observable.onErro...
Toshikotoss asked 9/4, 2018 at 19:27

1

Solved

Per the example below from the LiveData Android documentation, what would be the RxJava 2 equivalent? We certainly can use a combination of publish(), refcount() and replay() to achieve the core o...
Athletics asked 7/4, 2018 at 15:21

1

My API Client public class ApiClient { public static final String BASE_URL = "http://baseurl.com/wp-json/"; private static Retrofit retrofit = null; public static Retrofit getClient() { if (...
Mistreat asked 8/4, 2018 at 11:14

3

Solved

In rxjava 1 there Observable had this flatmap method public final Observable flatMap(Func1 collectionSelector, Func2 resultSelector) That allowed you to pass/combine the initial result to the fl...
Husk asked 9/3, 2017 at 13:15

3

After upgrading Android Studio 3.0 Beta 1 getting the following error. When I downgraded the error disappeared. Studio Build: Android Studio 3.0 Beta 1 Version of Gradle Plugin: 'com.android.too...

© 2022 - 2024 — McMap. All rights reserved.