当前位置:首页 > 服务端 > NullPointerException at android.widget.AbsListView.obtainView at android.widget.ListView.makeAndAddView

NullPointerException at android.widget.AbsListView.obtainView at android.widget.ListView.makeAndAddView

 

使用ExpandableListView的时候,报如下错。网上搜索发现原来是在CommonNumberQueryAdapter的getGroupView()方法里返回的是null,注意细节哦!!!

 

                                                 

12-19 17:32:41.822: E/AndroidRuntime(1894): FATAL EXCEPTION: main
12-19 17:32:41.822: E/AndroidRuntime(1894): java.lang.NullPointerException
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.widget.AbsListView.obtainView(AbsListView.java:2269)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.widget.ListView.makeAndAddView(ListView.java:1769)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.widget.ListView.fillDown(ListView.java:672)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.widget.ListView.fillSpecific(ListView.java:1330)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.widget.ListView.layoutChildren(ListView.java:1600)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.widget.AbsListView.onLayout(AbsListView.java:2102)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.View.layout(View.java:13754)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.ViewGroup.layout(ViewGroup.java:4362)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1649)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1507)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.widget.LinearLayout.onLayout(LinearLayout.java:1420)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.View.layout(View.java:13754)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.ViewGroup.layout(ViewGroup.java:4362)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.View.layout(View.java:13754)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.ViewGroup.layout(ViewGroup.java:4362)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1649)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1507)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.widget.LinearLayout.onLayout(LinearLayout.java:1420)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.View.layout(View.java:13754)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.ViewGroup.layout(ViewGroup.java:4362)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.View.layout(View.java:13754)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.ViewGroup.layout(ViewGroup.java:4362)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1866)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1687)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.Choreographer.doCallbacks(Choreographer.java:555)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.Choreographer.doFrame(Choreographer.java:525)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.os.Handler.handleCallback(Handler.java:615)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.os.Handler.dispatchMessage(Handler.java:92)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.os.Looper.loop(Looper.java:137)
12-19 17:32:41.822: E/AndroidRuntime(1894): at android.app.ActivityThread.main(ActivityThread.java:4745)
12-19 17:32:41.822: E/AndroidRuntime(1894): at java.lang.reflect.Method.invokeNative(Native Method)
12-19 17:32:41.822: E/AndroidRuntime(1894): at java.lang.reflect.Method.invoke(Method.java:511)
12-19 17:32:41.822: E/AndroidRuntime(1894): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
12-19 17:32:41.822: E/AndroidRuntime(1894): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-19 17:32:41.822: E/AndroidRuntime(1894): at dalvik.system.NativeStart.main(Native Method)

作者:McCa
来源链接:https://www.cnblogs.com/McCa/p/4174994.html

版权声明:
1、Java侠(https://www.javaxia.com)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。





本文链接:https://www.javaxia.com/server/124845.html

分享给朋友:

“NullPointerException at android.widget.AbsListView.obtainView at android.widget.ListView.makeAndAddView” 的相关文章