carousel-view
carousel-view copied to clipboard
Logcat crash error xml
Process: grand.app.elqasar, PID: 26848 kotlin.TypeCastException: null cannot be cast to non-null type alirezat775.lib.carouselview.CarouselLayoutManager at alirezat775.lib.carouselview.CarouselView.getManager(CarouselView.kt:77) at alirezat775.lib.carouselview.CarouselView.getParentAnchor(CarouselView.kt:250) at alirezat775.lib.carouselview.CarouselView.calculateSnapViewPosition(CarouselView.kt:265) at alirezat775.lib.carouselview.CarouselView.scrolling(CarouselView.kt:230) at alirezat775.lib.carouselview.CarouselView$initSnap$1.run(CarouselView.kt:101) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:234) at android.app.ActivityThread.main(ActivityThread.java:5526) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Would you please add your implementation?
I have the same issue. I think this is error from library
kotlin.TypeCastException: null cannot be cast to non-null type alirezat775.lib.carouselview.CarouselLayoutManager at alirezat775.lib.carouselview.CarouselView.getManager(CarouselView.kt:77) at alirezat775.lib.carouselview.CarouselView.getParentAnchor(CarouselView.kt:250) at alirezat775.lib.carouselview.CarouselView.calculateSnapViewPosition(CarouselView.kt:265) at alirezat775.lib.carouselview.CarouselView.scrolling(CarouselView.kt:230) at alirezat775.lib.carouselview.CarouselView$initSnap$1.run(CarouselView.kt:101) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:236) at android.app.ActivityThread.main(ActivityThread.java:8059) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
this is my xml implementation on fragment
<alirezat775.lib.carouselview.CarouselView
android:id="@+id/carousel_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollIndicators="bottom"
/>
you need to set variable manager : CarouselLayoutManager? as nullable
Hi @BayuWijayaPermanaPutra, thanks for asking, however, I couldn’t get your problem, may I ask you to add your implementation and explain the scenario that caused this problem?