SlideDateTimePicker Datetime picker open issue

in Library code able to change 2 classes 1. TimeFragment

@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    try {
            mCallback = (TimeChangedListener) getParentFragment();
    } catch (ClassCastException e) {
        throw new ClassCastException("Calling fragment must implement " + "TimeFragment.TimeChangedListener interface");
    }
}

2.Change following code in DateChangedListener

@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    try {
        mCallback = (DateChangedListener) getParentFragment();
    } catch (ClassCastException e) {
        throw new ClassCastException("Calling fragment must implement " + "DateFragment.DateChangedListener interface");
    }
}

3.SlideDateTimeDialogFragment

@Override
public Fragment getItem(int position) {
    switch (position) {
        case 0:
            DateFragment dateFragment = DateFragment.newInstance(
            mTheme,
            mCalendar.get(Calendar.YEAR),
            mCalendar.get(Calendar.MONTH),
            mCalendar.get(Calendar.DAY_OF_MONTH),
            mMinDate,
            mMaxDate);
            //  dateFragment.setTargetFragment(SlideDateTimeDialogFragment.this, 100);
            return dateFragment;
       case 1:
            TimeFragment timeFragment = TimeFragment.newInstance(
            mTheme,
            mCalendar.get(Calendar.HOUR_OF_DAY),
            mCalendar.get(Calendar.MINUTE),
            mIsClientSpecified24HourTime,
            mIs24HourTime);
            // timeFragment.setTargetFragment(SlideDateTimeDialogFragment.this, 200);
            return timeFragment;
            default:
                return null;
            }
        }
}

Here due to set setTargetFragment not able to load Fragment, need to comment and change getTargetFragment(); to getParentFragment()

// timeFragment.setTargetFragment(SlideDateTimeDialogFragment.this, 200);

Tags:

Android