Chapter 7. Safe Args: Passing Information
Sometimes fragments need extra information to work properly.
If a fragment shows details of a contact, for example, it needs to know which contact to display. But what if this information comes from another fragment? In this chapter, youâll build on your navigation know-how by learning how to pass data between fragments. Youâll find out how to add arguments to navigation destinations so they can receive the information they need. Youâll meet the Safe Args plug-in, and learn how to use it to write type-safe code. Finally, youâll discover how to manipulate the back stack, and take control of back button behavior. Read onâthereâs no going backâ¦
Get Head First Android Development, 3rd 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.