NullPointerException at android.widget.AbsListView.obtainView at android.widget.ListView.makeAndAddView
2024-08-09 00:13:09 218人阅读
使用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) |
NullPointerException at android.widget.AbsListView.obtainView at android.widget.ListView.makeAndAddView
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉:
投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。