3

Developing the UI with Fragments

This chapter covers fragments and the fragment lifecycle. It demonstrates how to use them to build efficient and dynamic layouts that respond to different screen sizes and configurations and allow you to divide your UI into different sections. By the end of this chapter, you will be able to create static and dynamic fragments, pass data to and from fragments and activities, and use the Jetpack Navigation component to detail how fragments fit together.

In the previous chapter, we explored the Android activity lifecycle and looked into how it is used in apps to navigate between screens. We also analyzed various types of launch modes, which defined how transitioning between screens happened. In this chapter, you’ll ...

Get How to Build Android Apps with Kotlin - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.