From the course: Building an Android App with Jetpack Libraries

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Add a second fragment to edit notes

Add a second fragment to edit notes - Android Tutorial

From the course: Building an Android App with Jetpack Libraries

Start my 1-month free trial

Add a second fragment to edit notes

- [Instructor] I finished the first steps in creating my application, displaying a list of data objects, notes. When the user taps on one of those notes, they expect to open a second screen and display that note for editing. In past versions of this app, the editor's screen was its own activity. In this version that uses the navigation component, it will be a fragment that serves as a navigation destination. To create that fragment, I'll go to my nav_graph.xml file. I'll close up some of these windows so I'm only looking at the navigation editor. And I'll create a new fragment. I'll click on this icon and choose "create new destination". And as I did previously with the first fragment, I'll use this template that generates a fragment with a ViewModel. I'll name this, "Editor Fragment". And I'll click finish, and I'll be creating three files, the Fragment Class, a layout file, and an associated ViewModel. And I'll…

Contents