Delete Data From Android Sdk Database Tables


show more Deleting data from database tables provides you with in-depth training on Developer. Taught by David Gassner as part of the Android SDK: Local Data Storage show less
please wait ...

Deleting data from database tables

At this point, my tour finder application uses two tables, one for the primary tour data, and one for a mytours table that tracks tours that the user has selected and I can look at a filtered view showing just those tours. I'd like to add functionality to the application that lets the user remove an item from that custom list. I've added some code to the application so that when the user goes into an item from the mytours list, they now see a menu choice, REMOVE FROM MY TOURS .

I'll show you how I did that. First, I'll go the XML file, tour_detail.xml that you can find in the resource area's menu folder. I've added a second item to the menu. Its ID is menu_delete, and this string menu_delete equates to the string you see on the screen, Remove from My Tours. Then I added logic to TourDetailActivity.java. In the CreateOptionsMenu method shown here, I now have code that filters which menu item is selected.

If we came from the My Tours view, then we are going to show the delete ...

Deleting data from database tables
Video duration: 10m 27s 3h 41m Intermediate

Viewers:

Deleting data from database tables provides you with in-depth training on Developer. Taught by David Gassner as part of the Android SDK: Local Data Storage

Subject:
Developer
Software:
Android Java
Author:
please wait ...