April 2019
Beginner to intermediate
698 pages
15h 15m
English
We can put whole Fragment instances as pages in a PagerAdapter. This is quite powerful because, as we know, a Fragment instance can have a large amount of functionality – even a fully-fledged UI.
To keep the code short and straightforward, we will add a single TextView to each Fragment layout, just to demonstrate that the pager is working. When we see how easy it is to get a reference to the TextView, however, it should be obvious how we could easily add any layout we have learned so far and then let the user interact with it.
In the next project, we will see yet another way to display multiple Fragment instances, NavigationView, and we will actually implement multiple coded Fragment instances.
The first thing ...
Read now
Unlock full access