简体   繁体   中英

Android: Error when scrolling down to the bottom of an ListView

I found a error that I didn't know about, I am using a List, when I am scrolling down to the bottom of the list it throws an error, why does this occur? I am getting the items from a service, and everything looks fine in ListView .

this is the error that it trows out.

09-25 16:58:01.865: ERROR/AndroidRuntime(609): FATAL EXCEPTION: main
09-25 16:58:01.865: ERROR/AndroidRuntime(609): java.lang.NullPointerException
09-25 16:58:01.865: ERROR/AndroidRuntime(609):     at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:355)
09-25 16:58:01.865: ERROR/AndroidRuntime(609):     at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)
....
....

似乎ArrayAdapter中的一项为空-因此,如果向下滚动到该项,则会得到NullPointerException。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM