Answer the question
In order to leave comments, you need to log in
How to save Bitmap to file asynchronously?
I want to save a Bitmap to a file. I do it through FileOutputStream. On StackOverflow they write that such operations need to be done asynchronously. I want to know if this can be achieved with the help of RxJava? If so, can you show me how?
Answer the question
In order to leave comments, you need to log in
Yes, it's better to do it in the background. More or less like this:
Disposable d = Observable.fromCallable(() -> {
// save bitmap
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question