PagerDatePicker
PagerDatePicker copied to clipboard
Date and position called twice and result not same with selected one
When I try to slide or click the date, the result is not same with what I select it, the date is sometimes next date or prev date and the result is called twice or more.
What I found out that OnViewCreated is called more than once in SimplePageFragment
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
TextView tvDate = view.findViewById(R.id.tv_date_label);
TextView tvPosition = view.findViewById(R.id.tv_position_label);
tvDate.setText(SIMPLE_DATE_FORMAT.format(date));
tvPosition.setText(String.valueOf(position));
Log.e("DATE RESULT", SIMPLE_DATE_FORMAT.format(date));
}
How to fix this problem ?