super.onCreate(icicle);
setContentView(R.layout.date_widgets_example_1);
mDateDisplay = (TextView) findViewById(R.id.dateDisplay);
Button pickDate = (Button) findViewById(R.id.pickDate);
pickDate.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
new DatePickerDialog(DateWidgets1.this,
mDateSetListener,
mYear, mMonth, mDay, Calendar.SUNDAY).show();
}
});
Button pickTime = (Button) findViewById(R.id.pickTime);
pickTime.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
new TimePickerDialog(DateWidgets1.this,
mTimeSetListener, "Set the time",
mHour, mMinute, false).show();
}
});
final Calendar c = Calendar.getInstance();
mYear = c.get(Calendar.YEAR);
mMonth = c.get(Calendar.MONTH);
mDay = c.get(Calendar.DAY_OF_MONTH);
mHour = c.get(Calendar.HOUR_OF_DAY);
mMinute = c.get(Calendar.MINUTE);
updateDisplay();