A (175)

(Tuis.) #1
CHAPTER 14: Android Content Providers: Providing Data to Applications 519


  1. Once you click the Finish button, Eclipse will open the empty
    user interface definition file, shown in Figure 14-5. As you can see, the
    required xmlns:android and android:layout_width parameters, as well as
    the android:layout_height parameters, are set to use the MATCH_PARENT
    constant. This will allow your UI design to be scaled up by Android to fill the
    display screen for your ContactGalaxy activity subclass.


Figure 14-5. Showing the parent tag in place in the activity_contact.xml user interface definition


Next you need to add an tag to your AndroidManifest.xml file so that your application
recognizes this new activity subclass. You will be doing even more configuration work in your
Android Manifest XML file later on during the chapter, when you add permissions so that you can
read and write data to a Content Provider.


Adding the ContactGalaxy Class to the Manifest


Right-click on your AndroidManifest.xml file and select Open. Add an tag under the


tag. Reference a contact_galaxy constant, which you will be creating during the
next steps in the work process. You will use this constant as the activity label (screen title). Set the
constant up using the following XML tag and parameter, as is shown in Figure 14-6:
Free download pdf