java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.sachin.myapplication/com.example.sachin.myapplication.Home}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.widget.DrawerLayout.setDrawerListener(android.support.v4.widget.DrawerLayout$DrawerListener)' on a null object reference

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by Sachin Solanki
, 1 year ago
Unable to start activity ComponentInfo{com.example.sachin.myapplication/com.example.sachin.myapplication.Home}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.widget.DrawerLayout.setDrawerListener(android.support.v4.widget.DrawerLayout$DrawerListener)' on a null object reference
via Stack Overflow by D4Developer
, 1 year ago
Unable to start activity ComponentInfo{scanlife.com.smartlabel_android/scanlife.com.smartlabel_android.navDrawer.SettingsActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.widget.DrawerLayout.setDrawerListener(android.support.v4.widget.DrawerLayout$DrawerListener)' on a null object reference
via Stack Overflow by Swanson
, 2 months ago
: com.example.robik.asd, PID: 27244 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.asd.asd/com.example.asd.asd.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.widget.DrawerLayout.addDrawerListener(android.support.v4.widget.DrawerLayout$DrawerListener)' on a null object reference
via Stack Overflow by Alan
, 1 year ago
Unable to start activity ComponentInfo{br.unisinos.mobicine/br.unisinos.mobicine.activities.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.view.ViewPager.setAdapter(android.support.v4.view.PagerAdapter)' on a null object reference
via Stack Overflow by Ramón Wilhelm
, 2 months ago
Unable to start activity ComponentInfo{com.example.fdai3744.t_online20/com.example.fdai3744.t_online20.SecondActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.view.ViewPager.setAdapter(android.support.v4.view.PagerAdapter)' on a null object reference
via Stack Overflow by omar
, 1 year ago
Unable to start activity ComponentInfo{com.emad.gooddeals/com.emad.gooddeals.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.widget.SwipeRefreshLayout.setOnRefreshListener(android.support.v4.widget.SwipeRefreshLayout$OnRefreshListener)' on a null object reference
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.sachin.myapplication/com.example.sachin.myapplication.Home}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.widget.DrawerLayout.setDrawerListener(android.support.v4.widget.DrawerLayout$DrawerListener)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 10 months ago
9 times, 11 months ago
6 times, 4 months ago
184 times, 9 months ago
16 times, 10 months ago
109 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.