O'Reilly logo

Reactive Android Programming by Tadas Subonis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

In this chapter, we refreshed our knowledge on the lifecycle of Activities and Fragments. Later, we used this knowledge to build and explore a few cases of how a memory and a thread leak can occur. This way, we clearly saw that Observables have to be manually terminated if they are endless (such as Observable.interval()) because they will be the reason for such leaks.

Next, we learned how to use the RxLifecycle library to easily terminate Subscriptions that are part of an Activity by binding them to the lifecycle of the Activity. This way, we ensure that the Activity and its resources will never be leaked in a very straightforward and easy-to-use way.

Finally, we used a newly acquired RxLifecycle library to fix our code that fetches ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required