三星Galaxy中过度滚动列表视图的异常
由于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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论