Solve Android Listview Addheaderview Setadapter when inexplicable nullpointerexception
Bug when changing the code
Bug 1:
E/androidruntime (15920): java.lang.RuntimeException:Unable to start activity componentinfo{}: Android.view.InflateException:Binary XML file line #35: Error inflating class fragment
Solution Ideas
Ran into Binary XML file line #35
1 go to check the relevant fragment XML configuration is correct
2 Check if import package is import android.app.v4.Fragment
Bug 2:
ListView inexplicably NullPointerException
E/androidruntime (18769): caused by:java.lang.NullPointerException
At Android.widget.ListView.clearRecycledState
At android.widget.ListView.resetList
Solution Ideas:
Check to see if the header or footer is loaded as follows:
View Header = Getlayoutinflater (). Inflate (R.layout.header, NULL); View footer = Getlayoutinflater (). Inflate (r.layout.footer, NULL);
Reference:
http://blog.sina.com.cn/s/blog_6e5195850101492t.html
┏┓┏┓//┏┛┻━━━┛┻┓//┃┃//┃━┃//┃┳┛┗┳┃//┃┃//┃┻┃//┃┃//┗━┓┏━┛// ┃┃ god beast bless ┃┃ Code no bug! ┃┗━━━┓// ┃┣┓// ┃┏┛// ┗┓┓┏━┳┓┏┛// ┃┫┫┃┫┫// ┗┻┛┗┻┛
Daily Diligence
Android Listview Addheaderview setadapter when inexplicable nullpointerexception solved