三星Galaxy中过度滚动列表视图的异常

发布于 2024-12-11 06:31:27 字数 3769 浏览 0 评论 0原文

由于samsung Galaxy Tab中的listview可以响应多余的滚动事件,并且由于我的一些特殊操作(删除listview的后端数据源),使得galaxy在处理多余的滚动消息时抛出运行时异常,即可以在下面找到。 我想让三星银河中的列表视图不响应多余的滚动事件。 有人可以告诉我如何设置列表视图来满足这个要求吗?

我得到的异常:

10-09 09:02:26.758: ERROR/AndroidRuntime(1845): java.lang.IndexOutOfBoundsException: Invalid index 12, size is 1
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at java.util.ArrayList.get(ArrayList.java:311)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.widget.HeaderViewListAdapter.isEnabled(HeaderViewListAdapter.java:164)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.widget.ListView.dispatchDrawWithExcessScroll_Default(ListView.java:3352)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.widget.ListView.dispatchDraw(ListView.java:3093)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.View.draw(View.java:6796)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.widget.AbsListView.draw(AbsListView.java:2545)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.View.draw(View.java:6796)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.View.draw(View.java:6796)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2078)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewRoot.draw(ViewRoot.java:1433)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1175)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1753)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.os.Looper.loop(Looper.java:123)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.app.ActivityThread.main(ActivityThread.java:4632)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at java.lang.reflect.Method.invokeNative(Native Method)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at java.lang.reflect.Method.invoke(Method.java:521)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at dalvik.system.NativeStart.main(Native Method)

Since the listview in samsung galaxy tab can respond to excess scroll event, and due to some of my special operation (delete the backend datasource for the listview), so that when the galaxy handle the excess scroll message, it throw a runtime exception, that can be found below.
I want to make the listview in samsung galaxy not respond the excess scroll event.
Can someone tell me how I can set the listview to meet this requirement?

The exception I got:

10-09 09:02:26.758: ERROR/AndroidRuntime(1845): java.lang.IndexOutOfBoundsException: Invalid index 12, size is 1
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at java.util.ArrayList.get(ArrayList.java:311)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.widget.HeaderViewListAdapter.isEnabled(HeaderViewListAdapter.java:164)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.widget.ListView.dispatchDrawWithExcessScroll_Default(ListView.java:3352)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.widget.ListView.dispatchDraw(ListView.java:3093)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.View.draw(View.java:6796)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.widget.AbsListView.draw(AbsListView.java:2545)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.View.draw(View.java:6796)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.View.draw(View.java:6796)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2078)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewRoot.draw(ViewRoot.java:1433)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1175)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1753)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.os.Looper.loop(Looper.java:123)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at android.app.ActivityThread.main(ActivityThread.java:4632)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at java.lang.reflect.Method.invokeNative(Native Method)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at java.lang.reflect.Method.invoke(Method.java:521)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
10-09 09:02:26.758: ERROR/AndroidRuntime(1845):     at dalvik.system.NativeStart.main(Native Method)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文