1. Add the following code to the
run
method of_AddTestAddressesAction
under the proper comment line.//TODO: Add Email Addresses newContact1.addString(Contact.EMAIL,Contact.ATTR_NONE, "[email protected]"); newContact2.addString(Contact.EMAIL,Contact.ATTR_NONE, "[email protected]"); newContact2.addString(Contact.EMAIL,Contact.ATTR_NONE, "[email protected]"); newContact2.addString(Contact.EMAIL,Contact.ATTR_NONE, "[email protected]");
Wow, that code segment looks really easy. The lines are all practically the same! Each line specifies the field as EMAIL
and the attributes as ATTR_NONE
, so there isn't much more to talk about except for the "what-ifs".
Much like the TEL
, things get a little trickier if you want to edit the contact in your application, but not as tricky as they are with the PHONE field. The addresses are stored in the same order that you added them to the field so you can use this fact to your advantage when editing. Because there...