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

Setting up an activity

From the flow that we have just analyzed, it can be seen that a great place to set up an Activity is the onCreate() call. Here, things such as setting up views, dependencies, parameter initialization/parsing--anything that will be used through the entire lifecycle of the Activity, usually go.

onStart() is a great place to initialize interactive operations. It can be a good place to start an Observable Subscription where the data is fetched. The logic is that onStop() will be called if a system Dialog is shown and, at this moment, there is no need to keep data updated because the user doesn't see it anyway. However, when the Dialog is closed, onStart() is called again and the data update resumes.

In our case, particularly, ...

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