-
Notifications
You must be signed in to change notification settings - Fork 86
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
NullPointerException #23
Comments
Wrap your <android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<android.support.v4.view.ViewPager
android:id="@+id/bottom_sheet_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.NestedScrollView> |
@hynra |
Is this reproducible with (corresponding adjustments inside) the example app from this repository? |
@laenger I'm also getting the same issue. If I use the same layout in the example app it works. However in my app it crashes with this error. If I remove viewpager from my layout the app doesn't crash. However on adding the viewpager it crashes! |
Looking at this again, it seems that #24 fixed this. |
I tried this fix already before it was merged. It seems to fix the error since we do a null check however the viewpager doesn't scroll anymore. If I try to scroll down the bottom sheet collapses. Maybe I am doing something wrong. Please help! |
Again, without a minimal reproducible example, it is very difficult to dig deeper into this. It would be great if you could modify the example app such that it runs into the described issue. |
I was having the same crash and it was because I wasn't adding any fragment to the view pager. Be sure to check that you're adding some fragment to the view pager so it can initiate right |
I have the same problem and a reprodcution path. You need to use a PagerAdapter instead of a FragmentPagerAdapter to reproduce it. |
I was also having this problem. I solved it by adding |
@daniellAlgar This solution is not correct, because of incorrect work of behavior. Think it would be helpful. But need to understand how to fix it in lib. |
For a better understanding, I show you how I use it.
|
i just integrated the library and i got this Error on launching the app
FATAL EXCEPTION: main Process: com.wadeeny.ondemand, PID: 20144 java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.view.View.isNestedScrollingEnabled()' on a null object reference at android.support.v4.view.ViewCompat$ViewCompatApi21Impl.isNestedScrollingEnabled(ViewCompat.java:1320) at android.support.v4.view.ViewCompat.isNestedScrollingEnabled(ViewCompat.java:3308) at biz.laenger.android.vpbs.ViewPagerBottomSheetBehavior.findScrollingChild(ViewPagerBottomSheetBehavior.java:609) at biz.laenger.android.vpbs.ViewPagerBottomSheetBehavior.findScrollingChild(ViewPagerBottomSheetBehavior.java:615) at biz.laenger.android.vpbs.ViewPagerBottomSheetBehavior.findScrollingChild(ViewPagerBottomSheetBehavior.java:622) at biz.laenger.android.vpbs.ViewPagerBottomSheetBehavior.onLayoutChild(ViewPagerBottomSheetBehavior.java:252) at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:894) at android.view.View.layout(View.java:19590) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1171) at android.view.View.layout(View.java:19590) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:19590) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:19590) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635) at android.widget.LinearLayout.onLayout(LinearLayout.java:1544) at android.view.View.layout(View.java:19590) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:19590) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635) at android.widget.LinearLayout.onLayout(LinearLayout.java:1544) at android.view.View.layout(View.java:19590) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at com.android.internal.policy.DecorView.onLayout(DecorView.java:758) at android.view.View.layout(View.java:19590) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2488) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2204) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1390) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6754) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:966) at android.view.Choreographer.doCallbacks(Choreographer.java:778) at android.view.Choreographer.doFrame(Choreographer.java:713) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:952) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:172) at android.app.ActivityThread.main(ActivityThread.java:6637) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
The text was updated successfully, but these errors were encountered: