Splitting the Tab
else if (r.getType().equals("take_out")) {
icon.setImageResource(R.drawable.ball_yellow);
}
else {
icon.setImageResource(R.drawable.ball_green);
}
}
}
}
Extra Credit.................................................................................................
Here are some things you can try beyond those step-by-step instructions:
- Add a date in the restaurant model to note the last time you visited
the restaurant, then use either DatePicker or DatePickerDialog to
allow users to set the date when they create their restaurant objects.
- Try making a version of the activity that uses a ViewFlipper and a
Button to flip from the list to the detail form, rather than using two
tabs.
Further Reading..........................................................................................
The use of tabs in an Android activity is covered in the "Employing Fancy
Widgets" chapter of The Busy Coder's Guide to Android Development.