java.lang.RuntimeException: Unable to start activity ComponentInfo{br.com.pedro.pedrodaumas/br.com.pedro.pedrodaumas.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' 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 Pedro Daumas
, 1 year ago
Unable to start activity ComponentInfo{br.com.pedro.pedrodaumas/br.com.pedro.pedrodaumas.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference
via Stack Overflow by Pedro Daumas
, 1 year ago
Unable to start activity ComponentInfo{br.com.pedro.pedrodaumas/br.com.pedro.pedrodaumas.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference
via Stack Overflow by Prashanth
, 2 years ago
Unable to start activity ComponentInfo{com.example.prashanth.sunshine/com.example.prashanth.sunshine.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference
via Stack Overflow by Mayank Khursija
, 2 years ago
Unable to start activity ComponentInfo{com.complaint/com.complaint.UserProfile}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference
via Stack Overflow by dvvcnxc
, 1 year ago
Unable to start activity ComponentInfo{com.nliplace.nli.unealta/com.nliplace.nli.unealta.scanwifi}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference
via Stack Overflow by Adriandmen
, 2 years ago
Unable to start activity ComponentInfo{com.adnan.figura/com.adnan.figura.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference
java.lang.RuntimeException: Unable to start activity ComponentInfo{br.com.pedro.pedrodaumas/br.com.pedro.pedrodaumas.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference
at br.com.pedro.pedrodaumas.MainActivity.onCreate(MainActivity.java:44)
at android.app.Activity.performCreate(Activity.java:6178)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

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