• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps app crashing after adding Navigation drawer

pezacide

Lurker
i have an app i have built and was working previously. I have attempted to add a navigation drawer and now i am getting the following crash message

05-13 14:44:28.107 8460-8460/com.mycompany.ihact D/AndroidRuntime﹕ Shutting down VM
--------- beginning of crash
05-13 14:44:28.107 8460-8460/com.mycompany.ihact E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.mycompany.ihact, PID: 8460
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mycompany.ihact/com.mycompany.ihact.MyActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBarDrawerToggle.syncState()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBarDrawerToggle.syncState()' on a null object reference
at com.mycompany.ihact.MyActivity.onPostCreate(MyActivity.java:118)
at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1186)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2280)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
05-13 14:47:09.716 8460-8462/com.mycompany.ihact W/art﹕ Suspending all threads took: 10.349ms
05-13 14:47:14.222 8460-8462/com.mycompany.ihact W/art﹕ Suspending all threads took: 8.041ms

i have searched for solutions and everything that is suggested doesn't seem to fix the issue. some solutions throw a different crash message but when i search that error i end up back a this one.
 
Back
Top Bottom