62.3k views
3 votes
1. Add the contact's cell phone number to the complex list. The list should display the contact name on the first line and Home: the number Cell: the number on the second line.

2. Find a small star-shaped graphic and add it to the layout if the contact is a "Best Friend Forever."

3. Add another line to the list so that the list displays

Contact Name
Street Address, City, State, Zip,
Phone Number
4. Modify the custom adapter to alternately display the contact name in red and blue. For example, the first name in the list will be red, the second will be blue, the third is red, and so on.

1 Answer

7 votes

Final answer:

The question pertains to modifying a contact list layout in an application to include additional contact details, a graphic for certain contacts, and altering text colors.

Step-by-step explanation:

To add a contact's cell phone number to the complex list, it should be displayed in the following format:

  • Contact Name
  • Home: the number
    Cell: the number

For a 'Best Friend Forever' contact, include a small star-shaped graphic by adding a specifically designed image view or icon to the layout.

Further, to display additional contact information, append another line to the list:

  • Contact Name
  • Street Address, City, State, Zip,
  • Phone Number

To modify the custom adapter for alternately displaying the contact name in red and blue, handle this in the getView method of the adapter by checking the position of the item and setting the text color accordingly.

For example, use a modulus operation to determine whether a name should be red or blue (e.g., if(position % 2 == 0) { set color to red } else { set color to blue }).

User Shekhar Jadhav
by
9.1k points

No related questions found