Who to find out the Id of TimePickerDialog?
Look at the 开发者_Go百科Title
I don't wont to make anything in the main.xml
As Mark said TimePickerDialog doesn´t have any id you want to create a TimePickerDialog?, this is a basic example ::
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//***Create your TimePickerDialog!!!
new TimePickerDialog(this,mTimeSetListener, 12, 12, false).show();
}
private TimePickerDialog.OnTimeSetListener mTimeSetListener=new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
Toast.makeText(GR_Comments.this, "my Time is :: " + hourOfDay + ":" + minute, Toast.LENGTH_LONG).show();
}
};
精彩评论