Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: onLongClick #58

Open
ankur2136 opened this issue Feb 24, 2018 · 0 comments
Open

Bug: onLongClick #58

ankur2136 opened this issue Feb 24, 2018 · 0 comments

Comments

@ankur2136
Copy link

Long Press on March 29, 2018 selects March 1 , 2018 due to the following code.

    Calendar calendar = Calendar.getInstance();
    calendar.setFirstDayOfWeek(firstDayOfWeek);
    calendar.setTime(calendar.getTime());
    calendar.set(Calendar.DAY_OF_MONTH, Integer.valueOf(dayOfMonthText.getText().toString()));

    markDateAsSelected(calendar.getTime());

You are setting the time from the same instance you are getting the time which is pretty useless.
I think you meant to use calendar.setTime(this.calendar.getTime());

Better yet, refactor the code to use member variable naming so this wouldn't happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant