java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference

Stack Overflow | mhkore | 7 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    How to set an adapter to my ListView with a viewpager and fragment

    Stack Overflow | 7 months ago | mhkore
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference

      at com.herprogramacin.hermosaprogramacion.UI.MainActivity$LoadData.onPostExecute()
    2. com.herprogramacin.hermosaprogramacion
      MainActivity$LoadData.onPostExecute
      1. com.herprogramacin.hermosaprogramacion.UI.MainActivity$LoadData.onPostExecute(MainActivity.java:215)
      2. com.herprogramacin.hermosaprogramacion.UI.MainActivity$LoadData.onPostExecute(MainActivity.java:195)
      2 frames
    3. Android Platform
      Looper.loop
      1. android.os.AsyncTask.finish(AsyncTask.java:651)
      2. android.os.AsyncTask.access$500(AsyncTask.java:180)
      3. android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:668)
      4. android.os.Handler.dispatchMessage(Handler.java:102)
      5. android.os.Looper.loop(Looper.java:158)
      5 frames