Record the solution to a choppy problem in the UI updated using retrofit + rxjava.

Source: Internet
Author: User

Record the solution to a choppy problem in the UI updated using retrofit + rxjava.

In a demo project, you can use rxjava + javasfit to download files and update the UI. No problems have been found,

UI progress update is also very comfortable.

But in our own project, after porting the code, we found that the UI does not update the progress, but refresh it after the download is complete.

In addition, during the entire download process, the app is obviously choppy. For example, if you press the back key, you will not be able to return it.

Later I thought about it. Will it be the problem of rxjava and retrofit versions?

I checked two version numbers in my project:

    //rxjava    compile 'io.reactivex:rxandroid:1.1.0'    compile 'io.reactivex:rxjava:1.1.5'    //network    compile 'com.squareup.retrofit2:retrofit:2.0.2'    compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'    compile 'com.squareup.okhttp3:okhttp:3.2.0'    compile 'com.squareup.okhttp3:logging-interceptor:3.0.1'

Let's take a look at the two version numbers in the demo project:

    //rxJava    compile 'io.reactivex:rxjava:latest.release'    compile 'io.reactivex:rxandroid:latest.release'    //network - squareup    compile 'com.squareup.retrofit2:retrofit:latest.release'    compile 'com.squareup.retrofit2:adapter-rxjava:latest.release'    compile 'com.squareup.okhttp3:okhttp:latest.release'    compile 'com.squareup.okhttp3:logging-interceptor:latest.release'

So I changed the two version numbers of my project to the two version numbers of the demo project to solve the problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.