armcha / LuseenBottomNavigation

BottomNavigationView Designed according Google guideLine
1.02k stars 180 forks source link

Set up with view pager keeps causing a Null pointer Exception #24

Closed amineMpdam closed 8 years ago

amineMpdam commented 8 years ago

AS MENTIONED IN the title i've set up the view pager, the color resources, and the images. The pager is assigned to an adapter, simply i keep getting a null pointer exception somehow java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mcubetechnologies.landolsi.cherni.onabupourvous/com.mcubetechnologies.landolsi.cherni.onabupourvous.MainActivity}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2389) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2441) at android.app.ActivityThread.access$900(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:5345) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at com.luseen.luseenbottomnavigation.BottomNavigation.BottomNavigationView.setUpWithViewPager(BottomNavigationView.java:366) at com.mcubetechnologies.landolsi.cherni.onabupourvous.MainActivity.onCreate(MainActivity.java:57) at android.app.Activity.performCreate(Activity.java:5343) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2343) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2441)  at android.app.ActivityThread.access$900(ActivityThread.java:151)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)  at android.os.Handler.dispatchMessage(Handler.java:110)  at android.os.Looper.loop(Looper.java:193)  at android.app.ActivityThread.main(ActivityThread.java:5345)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)  at dalvik.system.NativeStart.main(Native Method) `

amineMpdam commented 8 years ago

Problem Averted :+1: :) in fact i wasn't implementing the getPageTitle Method in my pager adapter, so i was getting null on the item title. Ps Great Library by the way :)

armcha commented 8 years ago

@amineMpdam Thanks :+1: