关于ListView的异常

    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getImportantForAccessibility()' on a null object reference
        at android.widget.AbsListView.obtainView(AbsListView.java:2647)
        at android.widget.HwAbsListView.obtainView(HwAbsListView.java:1309)
        at android.widget.ListView.measureHeightOfChildren(ListView.java:1510)
        at android.widget.ListView.onMeasure(ListView.java:1416)
        at android.view.View.measure(View.java:24895)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7078)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1580)
        at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1211)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:730)
        at android.view.View.measure(View.java:24895)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7078)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
        at android.view.View.measure(View.java:24895)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7078)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1580)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:849)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:728)
        at android.view.View.measure(View.java:24895)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7078)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
        at com.android.internal.policy.DecorView.onMeasure(DecorView.java:1045)
        at android.view.View.measure(View.java:24895)
        at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:3592)
        at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:2256)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2634)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2128)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8613)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1256)
        at android.view.Choreographer.doCallbacks(Choreographer.java:995)
        at android.view.Choreographer.doFrame(Choreographer.java:887)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1224)
        at android.os.Handler.handleCallback(Handler.java:900)
        at android.os.Handler.dispatchMessage(Handler.java:103)
        at android.os.Looper.loop(Looper.java:219)
        at android.app.ActivityThread.main(ActivityThread.java:8401)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1102)
I/Process: Sending signal. PID: 32440 SIG: 9

报错原因就是ListView的适配器中的方法getView()方法返回了个null

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值