I\'m having some issues implementing a TimePicker in my application that allows the user to change the time of a database record prior to inserting it.
The problem is th
this link shows that onTimeChanged();
is getting called which triggers the event dispatcher.
If you're not getting the events you need (even though it appears to be sending) you have have to
extend the default TimerPicker,
override mAmPmButton.setOnClickListener,
and include your version in the view.
mAmPmButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
requestFocus();
if (mIsAm) {
// Currently AM switching to PM
if (mCurrentHour < 12) {
mCurrentHour += 12;
}
} else {
// Currently PM switching to AM
if (mCurrentHour >= 12) {
mCurrentHour -= 12;
}
}
mIsAm = !mIsAm;
mAmPmButton.setText(mIsAm ? mAmText : mPmText);
onTimeChanged();
}
});