Caused by: java.lang.NullPointerException
at android.widget.ListView.clearRecycledState(ListView.java:522)
at android.widget.ListView.resetList(ListView.java:508)
at android.widget.ListView.setAdapter(ListView.java:440)
at com.company.myapp.MyActivity.refreshList(MyActivity.java:85)
at com.company.myapp.MyActivity.onCreate(MyActivity.java:37)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
... 11 mored
当发生这种状况。。。。,eclipse得到的异常就在你listView.setAdapter(adapter);这句话中。。。你怎么看listView和adapter都没有空值,正纳闷时
你应该要考虑一下被你添加的FooterView或者HeaderView是否为null,因为空的话。。。ListView就无法测量高度。。。然后无法布局。。最后就报错了。。。还有addFooterView和addHeaderView这两个方法一定要放在
listView.setAdapter(adapter);前面,要不然死活都不会出现你想要的FooterView或者HeaderView;