java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference

Stack Overflow | Joseph Joey | 5 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Custom listview throwing a null pointer exception

    Stack Overflow | 5 months ago | Joseph Joey
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference

      at com.example.joey.sunshine.CustomAdapter.getView()
    2. com.example.joey
      CustomAdapter.getView
      1. com.example.joey.sunshine.CustomAdapter.getView(CustomAdapter.java:62)
      1 frame
    3. Android Platform
      View.layout
      1. android.widget.AbsListView.obtainView(AbsListView.java:2347)
      2. android.widget.ListView.makeAndAddView(ListView.java:1864)
      3. android.widget.ListView.fillDown(ListView.java:698)
      4. android.widget.ListView.fillFromTop(ListView.java:759)
      5. android.widget.ListView.layoutChildren(ListView.java:1673)
      6. android.widget.AbsListView.onLayout(AbsListView.java:2151)
      7. android.view.View.layout(View.java:15761)
      7 frames