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

Android: App crashes with paged tableview (1.5.x regression)

    Details

      Description

      {html}<div><p>My app shows a list of games in a tableview. If there are more
      than 20, it will page the output. By this, I mean that it loads the
      first 20, then will have a 'touch for more' row at the bottom. When
      that is touched it will remove that row, and load 20 more. It loads
      these by creating the row objects (each with a unique className)
      and then calling a setData on the uploaded rowData list after all
      of the rows are created and added to the list.</p>
      <p>This works fine on iOS AND on Android build version=1.4.2
      timestamp=10/11/10 19:02 githash=425bc37, but I'm getting a weird
      crash bug on the 1.5.1 General release (version=1.5.1
      timestamp=12/16/10 16:25 githash=16bbb92) after loading the second
      page of games into the table. What happens is that I click the row
      to load more, more games are loaded (that works fine) and then as I
      scroll around (up or down), within 5-10 seconds the app will crash
      with the following exception:</p>
      <pre>
      <code>[TRACE] D/AndroidRuntime( 628): Shutting down VM
      [TRACE] W/dalvikvm( 628): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
      [TRACE] E/TiUncaughtHandler( 628): (main) [8606,794666] Sending event: exception on thread: main msg:java.lang.ArrayIndexOutOfBoundsException; Titanium 1.5.1,2010/12/16 16:25,6bbb92
      [TRACE] E/TiUncaughtHandler( 628): java.lang.ArrayIndexOutOfBoundsException
      [TRACE] E/TiUncaughtHandler( 628): at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:4078)
      [TRACE] E/TiUncaughtHandler( 628): at android.widget.AbsListView.trackMotionScroll(AbsListView.java:2915)
      [TRACE] E/TiUncaughtHandler( 628): at android.widget.AbsListView.onTouchEvent(AbsListView.java:2065)
      [TRACE] E/TiUncaughtHandler( 628): at android.widget.ListView.onTouchEvent(ListView.java:3315)
      [TRACE] E/TiUncaughtHandler( 628): at android.view.View.dispatchTouchEvent(View.java:3766)
      [TRACE] E/TiUncaughtHandler( 628): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)
      [TRACE] E/TiUncaughtHandler( 628): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
      [TRACE] E/TiUncaughtHandler( 628): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
      [TRACE] E/TiUncaughtHandler( 628): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
      [TRACE] E/TiUncaughtHandler( 628): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
      [TRACE] E/TiUncaughtHandler( 628): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
      [TRACE] E/TiUncaughtHandler( 628): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
      [TRACE] E/TiUncaughtHandler( 628): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)
      [TRACE] E/TiUncaughtHandler( 628): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
      [TRACE] E/TiUncaughtHandler( 628): at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
      [TRACE] E/TiUncaughtHandler( 628): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1655)
      [TRACE] E/TiUncaughtHandler( 628): at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)
      [TRACE] E/TiUncaughtHandler( 628): at android.os.Handler.dispatchMessage(Handler.java:99)
      [TRACE] E/TiUncaughtHandler( 628): at android.os.Looper.loop(Looper.java:123)
      [TRACE] E/TiUncaughtHandler( 628): at android.app.ActivityThread.main(ActivityThread.java:4627)
      [TRACE] E/TiUncaughtHandler( 628): at java.lang.reflect.Method.invokeNative(Native Method)
      [TRACE] E/TiUncaughtHandler( 628): at java.lang.reflect.Method.invoke(Method.java:521)
      [TRACE] E/TiUncaughtHandler( 628): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
      [TRACE] E/TiUncaughtHandler( 628): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
      [TRACE] E/TiUncaughtHandler( 628): at dalvik.system.NativeStart.main(Native Method)
      [TRACE] I/TiApplication( 628): (main) [141,794807] Analytics are disabled, ignoring postAnalyticsEvent
      [TRACE] E/AndroidRuntime( 628): FATAL EXCEPTION: main
      [TRACE] E/AndroidRuntime( 628): java.lang.ArrayIndexOutOfBoundsException
      [TRACE] E/AndroidRuntime( 628): at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:4078)
      [TRACE] E/AndroidRuntime( 628): at android.widget.AbsListView.trackMotionScroll(AbsListView.java:2915)
      [TRACE] E/AndroidRuntime( 628): at android.widget.AbsListView.onTouchEvent(AbsListView.java:2065)
      [TRACE] E/AndroidRuntime( 628): at android.widget.ListView.onTouchEvent(ListView.java:3315)
      [TRACE] E/AndroidRuntime( 628): at android.view.View.dispatchTouchEvent(View.java:3766)
      [TRACE] E/AndroidRuntime( 628): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)
      [TRACE] E/AndroidRuntime( 628): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
      [TRACE] E/AndroidRuntime( 628): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
      [TRACE] E/AndroidRuntime( 628): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
      [TRACE] E/AndroidRuntime( 628): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
      [TRACE] E/AndroidRuntime( 628): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
      [TRACE] E/AndroidRuntime( 628): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
      [TRACE] E/AndroidRuntime( 628): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)
      [TRACE] E/AndroidRuntime( 628): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
      [TRACE] E/AndroidRuntime( 628): at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
      [TRACE] E/AndroidRuntime( 628): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1655)
      [TRACE] E/AndroidRuntime( 628): at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)
      [TRACE] E/AndroidRuntime( 628): at android.os.Handler.dispatchMessage(Handler.java:99)
      [TRACE] E/AndroidRuntime( 628): at android.os.Looper.loop(Looper.java:123)
      [TRACE] E/AndroidRuntime( 628): at android.app.ActivityThread.main(ActivityThread.java:4627)
      [TRACE] E/AndroidRuntime( 628): at java.lang.reflect.Method.invokeNative(Native Method)
      [TRACE] E/AndroidRuntime( 628): at java.lang.reflect.Method.invoke(Method.java:521)
      [TRACE] E/AndroidRuntime( 628): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
      [TRACE] E/AndroidRuntime( 628): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
      [TRACE] E/AndroidRuntime( 628): at dalvik.system.NativeStart.main(Native Method)</code>
      </pre>
      <p>This ONLY happens after loading an additional page of results
      (which at that point I have 40 rows, with 40 different class
      names). It also only happens when I am using unique class names for
      each row. If I use the same className, I don't get the crash,
      however I need unique classnames as I will modify the row label
      colors on a per-row basis when clicked (if I don't have this, I'll
      get weird undefined results).</p>
      <p>Given the nature of this bug, I'm not so sure I can develop a
      test case for it. I did find the following:<br>
      <em><a href=
      "http://kevinmorey.com/post/990223225/arrayindexoutofboundsexception-with-custom-android">
      http://kevinmorey.com/post/990223225/arrayindexoutofboundsexception...</a></em>
      <a href=
      "http://stackoverflow.com/questions/2596547/arrayindexoutofboundsexception-with-custom-android-adapter-for-multiple-views-in">
      http://stackoverflow.com/questions/2596547/arrayindexoutofboundsexc...</a></p>
      <p>Perhaps one of those may point in the right direction. I can
      provide access to my code if necessary to aid with fixing of the
      bug.</p></div>{html}

        Attachments

          Activity

            People

            • Assignee:
              dthorp Don Thorp
              Reporter:
              robby Robby
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code