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

androidx RecyclerView #129

Open
HananMohamedMaiyas opened this issue Sep 6, 2020 · 2 comments
Open

androidx RecyclerView #129

HananMohamedMaiyas opened this issue Sep 6, 2020 · 2 comments

Comments

@HananMohamedMaiyas
Copy link

import android.support.annotation.Nullable;
import android.support.v7.widget.LinearSnapHelper;
import android.support.v7.widget.RecyclerView;

Expected Behavior /

scroll throw days

Actual Behavior

application crash when i scroll to left or right
i'm using androidx
it shows in run
java.lang.NullPointerException: Attempt to invoke virtual method 'void devs.mulham.horizontalcalendar.utils.HorizontalCalendarListener.onDateSelected(java.util.Calendar, int)' on a null object reference
at devs.mulham.horizontalcalendar.utils.HorizontalSnapHelper.notifyCalendarListener(HorizontalSnapHelper.java:46)
at devs.mulham.horizontalcalendar.utils.HorizontalSnapHelper.findSnapView(HorizontalSnapHelper.java:37)
at androidx.recyclerview.widget.SnapHelper.snapToTargetExistingView(SnapHelper.java:189)
at androidx.recyclerview.widget.SnapHelper$1.onScrollStateChanged(SnapHelper.java:51)
at androidx.recyclerview.widget.RecyclerView.dispatchOnScrollStateChanged(RecyclerView.java:5210)
at androidx.recyclerview.widget.RecyclerView.setScrollState(RecyclerView.java:1550)
at androidx.recyclerview.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:5397)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:871)
at android.view.Choreographer.doCallbacks(Choreographer.java:683)
at android.view.Choreographer.doFrame(Choreographer.java:616)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6313)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)

Specifications

  • Android Version:
  • Horizontal-Calendar Version:
@CollinsGichuki
Copy link

@HananMohamedMaiyas did you find a fix for this?

@aruns2896
Copy link

aruns2896 commented May 13, 2022

Use onDateSelected method to resolve like below
horizontalCalendar.setCalendarListener(new HorizontalCalendarListener() { @Override public void onDateSelected(Calendar date, int position) { } });

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

3 participants