Android lollipop date picker issue
Android lollipop date picker issue

Hi Guys,

This is my yet another post. Recently in one of my projects I faced an issue specific to Android 5.0 lollipop. The Date Picker View, OnDateChangedListener was never getting called.

While selecting the date, the change was being reflected on the view, but no call to the listener was made, and some other folks also faced the same issue. Check this stackoverflow question.

Solution:

As a workaround, I just checked the current values of picker after every interval.


@Override
public void onAttachedToWindow(){
if(android.os.Build.VERSION.SDK_INT>=android.os.Build.VERSION_CODES.LOLLIPOP)
check();
super.onAttachedToWindow();
}

You can use my class directly from here.

Have a nice day.

Leave a Reply