O'Reilly logo

Android User Interface Development by Jason Morris

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required