Answer the question
In order to leave comments, you need to log in
Rxjava load, save and display images in one pipeline?
Bottom line: you need to load the image, save it and display it. Everything works, but I don't like the current code:
Single.fromCallable { call.execute() }
.map { it.body?.byteStream() }
.map { BitmapFactory.decodeStream(it) }
.map {//это мне не нравится
it.compress(Bitmap.CompressFormat.JPEG, 90, getOutPutStream())
it
}
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribeBy({ it.printStackTrace() }, {
imageView.setImageBitmap(it)
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question