Join David Gassner for an in-depth discussion in this video Deleting notes, part of Building a Note-Taking App for Android (2013).
- View Offline
The note taking app now has the ability to add and update notes and now I want the…user to be able to delete notes as well. The user interface pattern for deleting…items from a list varies from one app to the next.…Unlike other mobile operating systems, there's no single required user interface…for this operation but the most common one you'll see, is the context menu.…When the user clicks and holds on an item, and then releases it.…Instead of being registered as a click, it's registered as a request for a menu.…
Then the menu can contain an option that lets them delete the selected item.…So that's how we'll implement it in our app.…I'll do all of this work in the main activity Java class.…The first step is to take the list control that's a part of our list activity and…register it for context menus. You do this by calling a method called…register for context menu. And you pass in the list view that's a…part of the list activity. I'll do this in the on create method, I'll…look at my main activity class in fullscreen mode.…
Like its companions, this course will take you through building a complete mobile app from scratch; but this installment uses the Android SDK and Java to get the job done. Author David Gassner shows you how to install the SDK and the Android Developer Toolkit, create a project, save data on a device, build and control screen layouts, and create action bars and icons that control navigation.
These three related courses will use the same assets to develop the same app. (See Building a Note-Taking App for iOS and Building a Note-Taking App for Windows Phone 8 and Windows Store for more information.) Compare and contrast the different steps and discover the similarities and differences!
- Previewing the note-taking app
- Creating virtual devices for testing
- Unique concepts in Android
- Creating the Eclipse project
- Using local data storage
- Adding and retrieving data with the Shared Preferences API
- Creating screen designs
- Creating and editing notes
- Supporting older versions of Android with ActionBarSherlock