Android Programming Tutorials

(Romina) #1

TUTORIAL 12


Getting More Active


In this tutorial, we will add support for both creating new restaurants and


editing ones that were previously entered. Along the way, we will get rid of


our tabs, splitting the application into two activities: one for the list, and


one for the detail form.


Step-By-Step Instructions.........................................................................


First, you need to have completed the previous tutorial. If you are


beginning the tutorials here, or if you wish to not use your existing work,


you can download a ZIP file with all of the tutorial results, and you can copy


the 11-Database edition of LunchList to use as a starting point.


Also, for this specific tutorial, since there is a lot of cutting and pasting, you


may wish to save off a copy of your current work before starting in on the


modifications, so you can clip code from the original and paste it where it is


needed.


Step #1: Create a Stub Activity...........................................................


The first thing we need to do is create an activity to serve as our detail form.


In a flash of inspiration, let's call it DetailForm. So, create a


LunchList/src/apt/tutorial/DetailForm.java file with the following content:


109
Free download pdf