2010-08-31 62 views

回答

0

正如馬克說TimePickerDialog doesn't有 你想創建一個TimePickerDialog任何ID?這是一個基本的例如::

@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(); 
     }   
    };