kaushikgopal / RxJava-Android-Samples

Learning RxJava for Android by example
Apache License 2.0
7.55k stars 1.37k forks source link

Update to Retrofit 2 #26

Closed pt2121 closed 8 years ago

kaushikgopal commented 9 years ago

Thank you so much for this! I haven't gotten time to look into Retrofit 2 in detail.

However, i do notice a crash if you run the Retrofit fragment example, then hit the back button - you'll notice an RxJava related exception. We should fix this probably before merging in :)

Let me know if you can't reproduce it.

pt2121 commented 9 years ago

Thanks! I am looking into this.

pt2121 commented 9 years ago

@kaushikgopal I checked this and it seems to be an AOSP/OkHttp bug. Android framework assumes OkHttp's cancel is blocking and yells android.os.NetworkOnMainThreadException. See https://github.com/square/okhttp/issues/1592, https://github.com/square/okhttp/issues/1862, and https://github.com/square/retrofit/issues/1046. Anyway, I added a workaround and rebased. Could you review this when have a chance?

kaushikgopal commented 8 years ago

@prt2121 it appears that we no longer require the workaround cause issues was fixed in a later version of okhttp. i've bumped the version(s) and merged in your code. Cheers and thanks for the great work!

pt2121 commented 8 years ago

@kaushikgopal thanks!