java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(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 Stack Overflow by Omar Abdelhafiz
, 10 months ago
Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
at com.example.omarabdelhafiz.civilengtaif.SurveyListAdapter.getView(SurveyListAdapter.java:27)
at android.widget.AbsListView.obtainView(AbsListView.java:2459)
at android.widget.ListView.makeAndAddView(ListView.java:1889)
at android.widget.ListView.fillDown(ListView.java:705)
at android.widget.ListView.fillFromTop(ListView.java:766)
at android.widget.ListView.layoutChildren(ListView.java:1690)
at android.widget.AbsListView.onLayout(AbsListView.java:2222)
at android.view.View.layout(View.java:15900)
at android.view.ViewGroup.layout(ViewGroup.java:5103)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1954)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1808)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1717)
at android.view.View.layout(View.java:15900)
at android.view.ViewGroup.layout(ViewGroup.java:5103)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:628)
at android.widget.FrameLayout.onLayout(FrameLayout.java:563)
at android.view.View.layout(View.java:15900)
at android.view.ViewGroup.layout(ViewGroup.java:5103)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1954)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1808)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1717)
at android.view.View.layout(View.java:15900)
at android.view.ViewGroup.layout(ViewGroup.java:5103)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:628)
at android.widget.FrameLayout.onLayout(FrameLayout.java:563)
at android.view.View.layout(View.java:15900)
at android.view.ViewGroup.layout(ViewGroup.java:5103)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2423)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2129)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6441)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:795)
at android.view.Choreographer.doCallbacks(Choreographer.java:598)
at android.view.Choreographer.doFrame(Choreographer.java:567)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:781)
at android.os.Handler.handleCallback(Handler.java:810)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:189)
at android.app.ActivityThread.main(ActivityThread.java:5535)
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:950)

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.