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.
Challenge: Support deleting all notes - Android Tutorial
From the course: Building an Android App with Jetpack Libraries
Challenge: Support deleting all notes
(upbeat music) - [Instructor] So far my application gives the user the ability to select individual notes, and then to delete them. But I also want them to be able to clear out the entire database with one gesture. For this challenge, I'll ask you to add functionality that lets the user do that from the options menu. I've already done it and I'll show you what this looks like. When the user touches the options menu icon, I've added a new item there labeled 'delete all notes.' And when I selected, all the data goes away. Now to prove that that's actually happening, I'll add some more sample data, and then I'll go back to my database inspector window, I'll show the data that's there, and I'll check this option to show live updates. Now, I'll set this up so I can see everything, then I'll go back to the application I'll delete all the notes, and everything disappearing from the database. I will add items and I'll delete them.…
Contents
-
-
-
-
-
-
-
(Locked)
Add an options menu to the main fragment4m
-
(Locked)
Add sample notes to the database6m 1s
-
(Locked)
Support selecting RecyclerView items7m 12s
-
(Locked)
Delete selected notes from the database4m 28s
-
(Locked)
Challenge: Support deleting all notes1m 57s
-
(Locked)
Solution: Support deleting all notes2m 1s
-
(Locked)
-
-