由于三星galaxy选项卡中的listview可以响应多余的滚动事件,并且由于我的一些特殊操作(删除listview的后端数据源),所以当galaxy处理多余的滚动消息时,它会抛出一个运行时例外,可以在下面找到。 我想让三星galaxy的listview不响应多余的滚动事件。 有人能告诉我如何设置listview以满足此要求吗?
我得到的例外:
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)