Time for action - adding telephone numbers

  1. Add the following code to the run method of the AddTestContacts 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");

What just happened?

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 ...

Get BlackBerry Java Application Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.