Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-15016

Android: TableView.headerView + swipe listener + no scrolling = crash

    Details

      Description

      The following code causes a crash when swiping the table up and down.

      To reproduce, change the number of rows (l) so that the table has as many rows it can take without needing to scroll.

      If you remove the headerView or the swipe event listener, it no longer crashes.

      var w = Ti.UI.createWindow({
          backgroundColor: '#fff'
      });
       
      var t = Ti.UI.createTableView();
       
      t.headerView = Ti.UI.createView({
          width: Ti.UI.FILL,
          height: 50,
          backgroundColor: 'red'
      });
       
      var d = [];
      var l = 12;
       
      for (var i = 0; i < l; i++) {
          d.push(Ti.UI.createTableViewRow({
              title: 'Row ' + i
          }));
      }
       
      t.setData(d);
       
      t.addEventListener('swipe', function () {
          Ti.API.info('swipe');
      });
       
      w.add(t);
      w.open();
      

      The crash log:

      08-16 09:31:41.133: E/MessageQueue-JNI(8879): java.lang.IndexOutOfBoundsException: Invalid index 12, size is 12
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at java.util.ArrayList.get(ArrayList.java:304)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at ti.modules.titanium.ui.widget.tableview.TiTableView.getItemAtPosition(TiTableView.java:411)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at ti.modules.titanium.ui.TableViewProxy.fireEvent(TableViewProxy.java:163)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at org.appcelerator.titanium.view.TiUIView.fireEvent(TiUIView.java:1476)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at org.appcelerator.titanium.view.TiUIView.fireEvent(TiUIView.java:1467)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at org.appcelerator.titanium.view.TiUIView$4.onFling(TiUIView.java:1187)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.GestureDetector.onTouchEvent(GestureDetector.java:1399)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at org.appcelerator.titanium.view.TiUIView$5.onTouch(TiUIView.java:1220)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.View.dispatchTouchEvent(View.java:7345)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2412)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2147)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2418)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2161)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2418)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2161)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2418)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2161)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2418)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2161)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2418)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2161)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2418)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2161)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2139)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1476)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.app.Activity.dispatchTouchEvent(Activity.java:2487)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2087)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.View.dispatchPointerEvent(View.java:7535)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3415)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3347)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4456)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4434)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4538)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.os.MessageQueue.nativePollOnce(Native Method)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.os.MessageQueue.next(MessageQueue.java:125)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.os.Looper.loop(Looper.java:124)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at android.app.ActivityThread.main(ActivityThread.java:4921)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at java.lang.reflect.Method.invokeNative(Native Method)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at java.lang.reflect.Method.invoke(Method.java:511)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
      08-16 09:31:41.133: E/MessageQueue-JNI(8879): 	at dalvik.system.NativeStart.main(Native Method)
      08-16 09:31:41.133: W/dalvikvm(8879): threadid=1: thread exiting with uncaught exception (group=0x412d22a0)
      08-16 09:31:41.138: E/TiApplication(8879): (main) [2677,10633] Sending event: exception on thread: main msg:java.lang.IndexOutOfBoundsException: Invalid index 12, size is 12; Titanium 3.1.2,2013/08/14 12:46,5ceaff8
      

        Attachments

          Activity

            People

            • Assignee:
              bijuexalture Biju pm
              Reporter:
              fokkezb Fokke Zandbergen
              Reviewer:
              Ping Wang
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-17319
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code