I have TimePicker in pop up dialog..
here is the code..
@Override
protected Dialog onCreateDialog(int id)
{
switch (id)
{
case TIME_DIALOG_ID:
// set time picker as current time
final TimePickerDialog tmp = new TimePickerDialog(this, timePickerListener, hour, minute, true);
tmp.setTitle("Helo");
tmp.setOnKeyListener(new OnKeyListener()
{
@Override
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event)
{
tmp.setTitle("Hello");
return false;
}
});
return tmp;
}
return null;
}
I’m using example from here.. http://www.mkyong.com/android/android-time-picker-example/
now I wan to remove title from dialog.. and set my custom title.. in this case I’m using
timepicker.setTitle(“Hello”); but when I’m changing values of timepicker.. title automatically changing to values of time.. how can I maintain title? or detect time changes..?
Thanks!
You can pass OnTimeSetListener in your TimePickerDialog() constructor and listen to time changes by overriding onTimeSet() method.