1. Add the following code to the
run
method of theAddTestContacts
menu item.//TODO: Add Phone numbers newContact1.addString(BlackBerryContact.TEL, BlackBerryContact.ATTR_MOBILE, "555-555-1212"); newContact2.addString(Contact.TEL,Contact.ATTR_HOME, "555-555-1234"); newContact2.addString(Contact.TEL,Contact.ATTR_FAX, "555-555-9999"); newContact2.addString(Contact.TEL, Contact.ATTR_MOBILE,"555-555-1313"); // This is bad! newContact2.addString(Contact.TEL,Contact.ATTR_FAX, "555-555-1414");
Working with phone numbers may look very straightforward, but there are many pitfalls to look out for here as well. Each phone number is added using the addString
method, which should look similar to the addStringArray
method that you just worked with. Again, the proper method to add the field is the one that matches the fields' type and has nothing to do with the name of the field or its function.
Also, like the previous example, the first parameter...