</RelativeLayout>
我们src下边的java
public class MainActivity extends Activity {
private TimePicker tp=null;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
this.tp=(TimePicker)super.findViewById(R.id.tp1);
//默认时间格式为12小时制的,这里我们改成24小时的制
this.tp.setIs24HourView(true);
//设置为22点22分
this.tp.setCurrentHour(22);
this.tp.setCurrentMinute(22);
}
}