Thanks to Tony for posting a workaround. This works for most of the time but not always. We had released our app with this workaround (along with version checks); however this solution failed on Samsung Galaxy Note GT-8000 (Android 4.4.2). Default 4.4.2 devices have this bug and solution works however Samsung seems to have fixed this issue in 4.4.2 release so onTimeSet() is called only once that we ignore and second call never happened.
We are posting a solution that we applied today. Though I am not happy with the solution as it is another hack/workaround but it may help in scenarios where version check doesn't help and OEMs merge selective fixes.
Our earlier implementation was
if((android.os.Build.VERSION.SDK_INT >=
Build.VERSION_CODES.ICE_CREAM_SANDWICH) &&
(android.os.Build.VERSION.SDK_INT <
Build.VERSION_CODES.LOLLIPOP)){
if(ccount == 1){
// Do Your Processing
count = 0;
}else{
// Ignore event. Bug in Android API
count++;
}
}else{
// Do Your Processing
}
Our New Implementation is
if((android.os.Build.VERSION.SDK_INT >=
Build.VERSION_CODES.ICE_CREAM_SANDWICH) &&
(android.os.Build.VERSION.SDK_INT <
Build.VERSION_CODES.LOLLIPOP)){
StackTraceElement[] stacktrace = Thread.currentThread().getStackTrace();
StackTraceElement e = stacktrace[4];
String methodName = e.getMethodName();
if(methodName.equals("onClick")){
// Do Your Processing
}else{
// Ignore event. Bug in Android API
}
}else{
// Do Your Processing
}
Hope it may help others.