Time for action - selecting date and time

We've made the SeekBar work as expected, but what about the date and time Button widgets? When the users touch them, they expect to be able to select a different date or time for their reservation. For this we'll need a good old OnClickListener, the DatePickerDialog and TimePickerDialog classes.

  1. Open the ReviewActivity Java source in your editor or IDE again.
  2. Add View.OnClickListener, DatePickerDialog.OnDateSetListener, and TimePickerDialog.OnTimeSetListener to the interfaces that ReviewActivity implements. Your class declaration should now look something like this:
    public class ReviewActivity extends TabActivity implements ViewSwitcher.ViewFactory, Runnable, AdapterView.OnItemSelectedListener, SeekBar.OnSeekBarChangeListener, ...

Get Android User Interface Development now with O’Reilly online learning.

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