FabulousFilter: NullPointerException in ViewPagerBottomSheetBehavior for sdk version 27

Hello, I tried to execute the fragment code exemple with the sdk version 27 and I get a crash although it works perfectly with sdk version 26.

May be I could try to fix it I i get enough free time 😉 This lib rocks, great work . 👍

Here’s the stacktrace :

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.widget.ViewDragHelper.processTouchEvent(android.view.MotionEvent)' on a null object reference at com.allattentionhere.fabulousfilter.viewpagerbottomsheet.ViewPagerBottomSheetBehavior.onTouchEvent(ViewPagerBottomSheetBehavior.java:274) at android.support.design.widget.CoordinatorLayout.resetTouchBehaviors(CoordinatorLayout.java:389) at android.support.design.widget.CoordinatorLayout.onAttachedToWindow(CoordinatorLayout.java:235) at android.view.View.dispatchAttachedToWindow(View.java:15543) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2955) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2962) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2962) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2962) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2962) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2962) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1650) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1366) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6768) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:926) at android.view.Choreographer.doCallbacks(Choreographer.java:735) at android.view.Choreographer.doFrame(Choreographer.java:667) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:912) at android.os.Handler.handleCallback(Handler.java:761) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:156) at android.app.ActivityThread.main(ActivityThread.java:6523) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 6
  • Comments: 15 (3 by maintainers)

Most upvoted comments

Hi everyone, i clone the repository and fix the bug. Add this code: if (mViewDragHelper == null) { mViewDragHelper = ViewDragHelper.create(parent, mDragCallback); } before mViewDragHelper.processTouchEvent(event); into ViewPagerBottomSheetBehavior file (line 274)

Hi everyone, Apologies for very late reply, I had lost my Github account and fortunately was able to get it back. I will soon look into it and update the repo.

Problem is at line 176. onLayoutChild override is never called when compiling with sdk 27, so mViewDragHelper is null. I’m not sure what is the reason, either it’s some kind of bug in sdk 27, or some api changes (but I can’t find any info about that).

If anybody have some idea, I would be happy to see.