Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1970] Android: calling TableView.setData while table is being rendered can cause crash

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:57:41.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0
ComponentsAndroid
Labelsandroid, defect
ReporterBill Dawson
AssigneeBill Dawson
Created2011-04-15T03:06:54.000+0000
Updated2011-04-17T01:57:41.000+0000

Description

Similar to #1945 but not exactly the same.

The failcase for this is from a customer. I can re-create it easily with their application, but because it's a timing issue I haven't been able to make it happen with a simplified application.

Here is the trace of the crash, which is caused by an ArrayIndexOutOfBoundsException.

java.lang.ArrayIndexOutOfBoundsException
at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:4078)
at android.widget.ListView.layoutChildren(ListView.java:1514)
at android.widget.AbsListView.onLayout(AbsListView.java:1147)
at android.view.View.layout(View.java:7034)
at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
at android.view.View.layout(View.java:7034)
at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:314)
at android.view.View.layout(View.java:7034)
at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
at android.view.View.layout(View.java:7034)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1125)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1042)
at android.view.View.layout(View.java:7034)
at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
at android.view.View.layout(View.java:7034)
at android.view.ViewRoot.performTraversals(ViewRoot.java:1049)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1744)

Comments

  1. Bill Dawson 2011-04-15

    (from [bc0ae2a7f61ffc3ce893dd5724dccf3a97122703]) [#1970 state:fixed-in-qa] Methods that add or remove rows now go to the UI thread so that they cannot affect the view model while the UI is rendering the table. http://github.com/appcelerator/titanium_mobile/commit/bc0ae2a7f61ffc3ce893dd5724dccf3a97122703"> http://github.com/appcelerator/titanium_mobile/commit/bc0ae2a7f61ff...

  2. Thomas Huelbert 2011-04-15

    1.4.2 80434d G1, EVO 4.

JSON Source