java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setDrawingCacheBackgroundColor(int)' 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 segmentfault.com by Unknown author, 1 year ago
Attempt to invoke virtual method 'void android.view.View.setDrawingCacheBackgroundColor(int)' on a null object reference
via csdn.net by Unknown author, 1 year ago
Attempt to invoke virtual method 'void android.view.View.setDrawingCacheBackgroundColor(int)' on a null object reference
via Stack Overflow by Devrath
, 4 months ago
Attempt to invoke virtual method 'int android.view.View.getImportantForAccessibility()' on a null object reference
via Stack Overflow by Umesh Devani
, 4 months ago
Attempt to invoke virtual method 'int android.view.View.getImportantForAccessibility()' on a null object reference
via Stack Overflow by Unknown author, 2 years ago
Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference at com.example.sairav.app3.MainActivity$1.getView(MainActivity.java:38)***
via Stack Overflow by Aseem Savio
, 1 year ago
Attempt to invoke virtual method 'int android.view.View.getImportantForAccessibility()' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setDrawingCacheBackgroundColor(int)' on a null object reference
at android.widget.AbsListView.obtainView(AbsListView.java:2494)
at android.widget.ListView.makeAndAddView(ListView.java:1894)
at android.widget.ListView.fillDown(ListView.java:710)
at android.widget.ListView.fillSpecific(ListView.java:1372)
at android.widget.ListView.layoutChildren(ListView.java:1673)
at android.widget.AbsListView.onLayout(AbsListView.java:2227)
at android.view.View.layout(View.java:15912)
at android.view.ViewGroup.layout(ViewGroup.java:5108)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:633)
at android.widget.FrameLayout.onLayout(FrameLayout.java:568)
at android.view.View.layout(View.java:15912)
at android.view.ViewGroup.layout(ViewGroup.java:5108)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1195)
at android.view.View.layout(View.java:15912)
at android.view.ViewGroup.layout(ViewGroup.java:5108)
at android.view.View.layout(View.java:15912)
at android.view.ViewGroup.layout(ViewGroup.java:5108)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1195)
at android.view.View.layout(View.java:15912)
at android.view.ViewGroup.layout(ViewGroup.java:5108)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:633)
at android.widget.FrameLayout.onLayout(FrameLayout.java:568)
at android.view.View.layout(View.java:15912)
at android.view.ViewGroup.layout(ViewGroup.java:5108)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1195)
at android.view.View.layout(View.java:15912)
at android.view.ViewGroup.layout(ViewGroup.java:5108)
at android.view.View.layout(View.java:15912)
at android.view.ViewGroup.layout(ViewGroup.java:5108)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1195)
at android.view.View.layout(View.java:15912)
at android.view.ViewGroup.layout(ViewGroup.java:5108)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:633)
at android.widget.FrameLayout.onLayout(FrameLayout.java:568)
at android.view.View.layout(View.java:15912)
at android.view.ViewGroup.layout(ViewGroup.java:5108)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1959)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1813)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1722)
at android.view.View.layout(View.java:15912)
at android.view.ViewGroup.layout(ViewGroup.java:5108)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:633)
at android.widget.FrameLayout.onLayout(FrameLayout.java:568)
at android.view.View.layout(View.java:15912)
at android.view.ViewGroup.layout(ViewGroup.java:5108)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2460)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2152)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1277)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6483)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:802)
at android.view.Choreographer.doCallbacks(Choreographer.java:605)
at android.view.Choreographer.doFrame(Choreographer.java:574)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:788)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5549)
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:964)

Users with the same issue

Once, 1 year ago
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 4 months ago
Samebug visitor profile picture
Unknown user
Once, 5 months ago
Samebug visitor profile picture
Unknown user
Once, 10 months ago

Write tip

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