Setting up the library

First of all, let's set up the library so that it can be used in the code. Again, this is a very straightforward thing to do. Just add the following lines to the app/build.gradle file:

compile 'com.trello.rxlifecycle2:rxlifecycle:2.0.1'
compile 'com.trello.rxlifecycle2:rxlifecycle-android:2.0.1'
compile 'com.trello.rxlifecycle2:rxlifecycle-components:2.0.1'

The first line adds support for general lifecycle management:

compile 'com.trello.rxlifecycle2:rxlifecycle:2.0.1'

It means that this library can be used not only for Android. The following line adds the necessary support for Android Platform:

compile 'com.trello.rxlifecycle2:rxlifecycle-android:2.0.1'

This line includes custom Activities for subclassing for even easier access to lifecycle management:

compile 'com.trello.rxlifecycle2:rxlifecycle-components:2.0.1'
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.51.153