/* 取得TimePicker对象,并设定为24小时制显示 */ tp = (TimePicker) findViewById(R.id.tPicker); tp.setIs24HourView(true); tp.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener() { @Override public void onTimeChanged(TimePicker view, int hourOfDay, int minute) { mHour = hourOfDay; mMinute = minute; /* 处理业务逻辑 */ } });