Problem
Several performance issues with tableview on Android.
Expected result
Applying a classname attribute to all rows should solve these issues and so we did.
Actual results
Now the app crashes continously but not at the same point each time we try.
Developer remarks
Unfortunately we tried several things to avoid this issue
* changed tableview's data creation to tableview.data = [row1,row2,...]; instead of creating an empty data array on tableview creation and add rows via appendRow();
* removed startLayout() and finishLayout()
* placed classname attribute at different possitions (seems to be important: classname in createTableViewRow({classname:...}) and the error occurs even earlier as if you place it as row.classname = ... somewhere after the creation part)
Sometimes the error occurs during TableView creation and sometimes during scrolling and sometimes it doesn't appear.
Stack Trace
{noformat}
[WARN][dalvikvm( 636)] threadid=1: thread exiting with uncaught exception (group=0x4001d800)
[ERROR][TiApplication( 636)] (main) [1466163,1660888] Sending event: exception on thread: main msg:java.lang.ArrayIndexOutOfBoundsException; Titanium 2.1.3,2012/10/02 16:16,15997d0
[ERROR][TiApplication( 636)] java.lang.ArrayIndexOutOfBoundsException
[ERROR][TiApplication( 636)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.applyChildProxies(TiTableViewRowProxyItem.java:164)
[ERROR][TiApplication( 636)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.refreshControls(TiTableViewRowProxyItem.java:144)
[ERROR][TiApplication( 636)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:280)
[ERROR][TiApplication( 636)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:83)
[ERROR][TiApplication( 636)] at ti.modules.titanium.ui.widget.tableview.TiTableView$TTVListAdapter.getView(TiTableView.java:216)
[ERROR][TiApplication( 636)] at android.widget.AbsListView.obtainView(AbsListView.java:1294)
[ERROR][TiApplication( 636)] at android.widget.ListView.makeAndAddView(ListView.java:1727)
[ERROR][TiApplication( 636)] at android.widget.ListView.fillDown(ListView.java:652)
[ERROR][TiApplication( 636)] at android.widget.ListView.fillGap(ListView.java:623)
[ERROR][TiApplication( 636)] at android.widget.AbsListView.trackMotionScroll(AbsListView.java:2944)
[ERROR][TiApplication( 636)] at android.widget.AbsListView.onTouchEvent(AbsListView.java:2065)
[ERROR][TiApplication( 636)] at android.widget.ListView.onTouchEvent(ListView.java:3315)
[ERROR][TiApplication( 636)] at android.view.View.dispatchTouchEvent(View.java:3766)
[ERROR][TiApplication( 636)] at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)
[ERROR][TiApplication( 636)] at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
[ERROR][TiApplication( 636)] at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
[ERROR][TiApplication( 636)] at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
[ERROR][TiApplication( 636)] at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
[ERROR][TiApplication( 636)] at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
[ERROR][TiApplication( 636)] at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
[ERROR][TiApplication( 636)] at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
[ERROR][TiApplication( 636)] at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)
[ERROR][TiApplication( 636)] at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
[ERROR][TiApplication( 636)] at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
[ERROR][TiApplication( 636)] at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1655)
[ERROR][TiApplication( 636)] at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)
[ERROR][TiApplication( 636)] at android.os.Handler.dispatchMessage(Handler.java:99)
[ERROR][TiApplication( 636)] at android.os.Looper.loop(Looper.java:123)
[ERROR][TiApplication( 636)] at android.app.ActivityThread.main(ActivityThread.java:4627)
[ERROR][TiApplication( 636)] at java.lang.reflect.Method.invokeNative(Native Method)
[ERROR][TiApplication( 636)] at java.lang.reflect.Method.invoke(Method.java:521)
[ERROR][TiApplication( 636)] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
[ERROR][TiApplication( 636)] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
[ERROR][TiApplication( 636)] at dalvik.system.NativeStart.main(Native Method)
[ERROR][AndroidRuntime( 636)] FATAL EXCEPTION: main
[ERROR][AndroidRuntime( 636)] java.lang.ArrayIndexOutOfBoundsException
[ERROR][AndroidRuntime( 636)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.applyChildProxies(TiTableViewRowProxyItem.java:164)
[ERROR][AndroidRuntime( 636)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.refreshControls(TiTableViewRowProxyItem.java:144)
[ERROR][AndroidRuntime( 636)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:280)
[ERROR][AndroidRuntime( 636)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:83)
[ERROR][AndroidRuntime( 636)] at ti.modules.titanium.ui.widget.tableview.TiTableView$TTVListAdapter.getView(TiTableView.java:216)
[ERROR][AndroidRuntime( 636)] at android.widget.AbsListView.obtainView(AbsListView.java:1294)
[ERROR][AndroidRuntime( 636)] at android.widget.ListView.makeAndAddView(ListView.java:1727)
[ERROR][AndroidRuntime( 636)] at android.widget.ListView.fillDown(ListView.java:652)
[ERROR][AndroidRuntime( 636)] at android.widget.ListView.fillGap(ListView.java:623)
[ERROR][AndroidRuntime( 636)] at android.widget.AbsListView.trackMotionScroll(AbsListView.java:2944)
[ERROR][AndroidRuntime( 636)] at android.widget.AbsListView.onTouchEvent(AbsListView.java:2065)
[ERROR][AndroidRuntime( 636)] at android.widget.ListView.onTouchEvent(ListView.java:3315)
[ERROR][AndroidRuntime( 636)] at android.view.View.dispatchTouchEvent(View.java:3766)
[ERROR][AndroidRuntime( 636)] at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)
[ERROR][AndroidRuntime( 636)] at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
[ERROR][AndroidRuntime( 636)] at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
[ERROR][AndroidRuntime( 636)] at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
[ERROR][AndroidRuntime( 636)] at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
[ERROR][AndroidRuntime( 636)] at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
[ERROR][AndroidRuntime( 636)] at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
[ERROR][AndroidRuntime( 636)] at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
[ERROR][AndroidRuntime( 636)] at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)
[ERROR][AndroidRuntime( 636)] at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
[ERROR][AndroidRuntime( 636)] at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
[ERROR][AndroidRuntime( 636)] at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1655)
[ERROR][AndroidRuntime( 636)] at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)
[ERROR][AndroidRuntime( 636)] at android.os.Handler.dispatchMessage(Handler.java:99)
[ERROR][AndroidRuntime( 636)] at android.os.Looper.loop(Looper.java:123)
[ERROR][AndroidRuntime( 636)] at android.app.ActivityThread.main(ActivityThread.java:4627)
[ERROR][AndroidRuntime( 636)] at java.lang.reflect.Method.invokeNative(Native Method)
[ERROR][AndroidRuntime( 636)] at java.lang.reflect.Method.invoke(Method.java:521)
[ERROR][AndroidRuntime( 636)] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
[ERROR][AndroidRuntime( 636)] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
[ERROR][AndroidRuntime( 636)] at dalvik.system.NativeStart.main(Native Method)
{noformat}
Additional inputs
I compared our version with the KitchenSink exmaples but i didn't find any important differences. Therefore I'm not able to create some code that reproduces this error but maybe the following code samples of our app may help you.
Repro sequence
Just scroll down/up on a device to replicate
var win = Titanium.UI.createWindow({
title : 'Tab 2',
backgroundColor : '#fff',
width : Ti.UI.FILL,
height : Ti.UI.FILL,
exitOnClose : true,
});
var tableView = Titanium.UI.createTableView({
width : Ti.UI.FILL,
height : Ti.UI.FILL
});
var section = Ti.UI.createTableViewSection();
for (var i = 0; i < 100; i++) {
var row = Ti.UI.createTableViewRow({
className : 'row'//having this enabled, causes the issue
});
var view = Ti.UI.createView();
view.add(Ti.UI.createLabel({
text : '1',
left : '10 dp'
}));
if (i % 2 === 0)
view.add(Ti.UI.createLabel({
text : '2',
right : '10 dp',
}));
row.add(view);
section.add(row);
}
tableView.data = [section];
win.add(tableView);
win.open();
Stack trace - Razr 2.3.5
11-29 12:32:15.942: I/ActivityManager(499): Start proc com.appc.test for activity com.appc.test/._1bestpracticesActivity: pid=3412 uid=10148 gids={1015, 3003}
11-29 12:32:15.997: I/TiApplication(3412): (main) [0,0] checkpoint, app created.
11-29 12:32:16.036: I/TiApplication(3412): (main) [39,39] Titanium 2.1.3 (2012/10/02 16:16 15997d0)
11-29 12:32:16.216: I/TiDbHelper(3412): (main) [182,221] No value in database for platform key: 'unique_machine_id' returning supplied default ''
11-29 12:32:16.223: I/TiDbHelper(3412): (main) [4,225] No value in database for platform key: 'hardware_machine_id' returning supplied default ''
11-29 12:32:16.294: I/TiApplication(3412): (main) [68,293] Titanium Javascript runtime: v8
11-29 12:32:16.294: D/dalvikvm(3412): Trying to load lib /data/data/com.appc.test/lib/libstlport_shared.so 0x4051cd78
11-29 12:32:16.302: D/dalvikvm(3412): Added shared lib /data/data/com.appc.test/lib/libstlport_shared.so 0x4051cd78
11-29 12:32:16.302: D/dalvikvm(3412): No JNI_OnLoad found in /data/data/com.appc.test/lib/libstlport_shared.so 0x4051cd78, skipping init
11-29 12:32:16.302: D/dalvikvm(3412): Trying to load lib /data/data/com.appc.test/lib/libkroll-v8.so 0x4051cd78
11-29 12:32:16.309: D/dalvikvm(3412): Added shared lib /data/data/com.appc.test/lib/libkroll-v8.so 0x4051cd78
11-29 12:32:16.333: I/TiRootActivity(3412): (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
11-29 12:32:16.387: D/TiAnalyticsDb(3412): (main) [59,59] Creating Database tianalytics.db
11-29 12:32:16.387: I/TiAnalyticsDb(3412): (main) [1,60] Upgrading Database from 1 to 4
11-29 12:32:16.528: E/TiApplication(3412): (KrollRuntimeThread) [135,195] APP PROXY: ti.modules.titanium.app.AppModule@405e5f90
11-29 12:32:16.544: W/V8Object(3412): Runtime disposed, cannot set property 'userAgent'
11-29 12:32:16.778: D/dalvikvm(3412): GC_EXTERNAL_ALLOC freed 1178K, 47% free 3786K/7111K, external 2741K/2773K, paused 36ms
11-29 12:32:16.825: D/dalvikvm(3412): Trying to load lib /data/data/com.appc.test/lib/libtiverify.so 0x4051cd78
11-29 12:32:16.825: D/dalvikvm(3412): Added shared lib /data/data/com.appc.test/lib/libtiverify.so 0x4051cd78
11-29 12:32:16.825: I/TiRootActivity(3412): (main) [0,0] checkpoint, on root activity resume. activity = com.appc.test._1bestpracticesActivity@405bcd50
11-29 12:32:16.911: W/InputManagerService(499): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@407d2688 (uid=10035 pid=917)
11-29 12:32:16.919: I/gralloc(499): Allocated 0x660072 size 6488161
11-29 12:32:16.973: I/ActivityManager(499): Displayed com.appc.test/._1bestpracticesActivity: +1s38ms
11-29 12:32:17.052: I/ActivityManager(499): No longer want com.motorola.blur.home.other (pid 1999): hidden #21
11-29 12:32:18.052: I/gralloc(499): Allocated 0x660072 size 6488161
11-29 12:32:19.802: D/AndroidRuntime(3412): Shutting down VM
11-29 12:32:19.802: W/dalvikvm(3412): threadid=1: thread exiting with uncaught exception (group=0x4001e560)
11-29 12:32:19.848: E/TiApplication(3412): (main) [2976,2976] Sending event: exception on thread: main msg:java.lang.ArrayIndexOutOfBoundsException; Titanium 2.1.3,2012/10/02 16:16,15997d0
11-29 12:32:19.848: E/TiApplication(3412): java.lang.ArrayIndexOutOfBoundsException
11-29 12:32:19.848: E/TiApplication(3412): at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.applyChildProxies(TiTableViewRowProxyItem.java:164)
11-29 12:32:19.848: E/TiApplication(3412): at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.refreshControls(TiTableViewRowProxyItem.java:144)
11-29 12:32:19.848: E/TiApplication(3412): at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:280)
11-29 12:32:19.848: E/TiApplication(3412): at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:83)
11-29 12:32:19.848: E/TiApplication(3412): at ti.modules.titanium.ui.widget.tableview.TiTableView$TTVListAdapter.getView(TiTableView.java:216)
11-29 12:32:19.848: E/TiApplication(3412): at android.widget.AbsListView.obtainView(AbsListView.java:1435)
11-29 12:32:19.848: E/TiApplication(3412): at android.widget.ListView.makeAndAddView(ListView.java:1824)
11-29 12:32:19.848: E/TiApplication(3412): at android.widget.ListView.fillDown(ListView.java:689)
11-29 12:32:19.848: E/TiApplication(3412): at android.widget.ListView.fillGap(ListView.java:658)
11-29 12:32:19.848: E/TiApplication(3412): at android.widget.AbsListView.trackMotionScroll(AbsListView.java:3469)
11-29 12:32:19.848: E/TiApplication(3412): at android.widget.AbsListView.onTouchEvent(AbsListView.java:2276)
11-29 12:32:19.848: E/TiApplication(3412): at android.widget.ListView.onTouchEvent(ListView.java:3535)
11-29 12:32:19.848: E/TiApplication(3412): at android.view.View.dispatchTouchEvent(View.java:3885)
11-29 12:32:19.848: E/TiApplication(3412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
11-29 12:32:19.848: E/TiApplication(3412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
11-29 12:32:19.848: E/TiApplication(3412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
11-29 12:32:19.848: E/TiApplication(3412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
11-29 12:32:19.848: E/TiApplication(3412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
11-29 12:32:19.848: E/TiApplication(3412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
11-29 12:32:19.848: E/TiApplication(3412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
11-29 12:32:19.848: E/TiApplication(3412): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1921)
11-29 12:32:19.848: E/TiApplication(3412): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1196)
11-29 12:32:19.848: E/TiApplication(3412): at android.app.Activity.dispatchTouchEvent(Activity.java:2155)
11-29 12:32:19.848: E/TiApplication(3412): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1905)
11-29 12:32:19.848: E/TiApplication(3412): at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2249)
11-29 12:32:19.848: E/TiApplication(3412): at android.view.ViewRoot.handleMessage(ViewRoot.java:1933)
11-29 12:32:19.848: E/TiApplication(3412): at android.os.Handler.dispatchMessage(Handler.java:99)
11-29 12:32:19.848: E/TiApplication(3412): at android.os.Looper.loop(Looper.java:130)
11-29 12:32:19.848: E/TiApplication(3412): at android.app.ActivityThread.main(ActivityThread.java:3859)
11-29 12:32:19.848: E/TiApplication(3412): at java.lang.reflect.Method.invokeNative(Native Method)
11-29 12:32:19.848: E/TiApplication(3412): at java.lang.reflect.Method.invoke(Method.java:507)
11-29 12:32:19.848: E/TiApplication(3412): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:840)
11-29 12:32:19.848: E/TiApplication(3412): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:598)
11-29 12:32:19.848: E/TiApplication(3412): at dalvik.system.NativeStart.main(Native Method)
11-29 12:32:19.927: E/AndroidRuntime(3412): FATAL EXCEPTION: main
11-29 12:32:19.927: E/AndroidRuntime(3412): java.lang.ArrayIndexOutOfBoundsException
11-29 12:32:19.927: E/AndroidRuntime(3412): at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.applyChildProxies(TiTableViewRowProxyItem.java:164)
11-29 12:32:19.927: E/AndroidRuntime(3412): at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.refreshControls(TiTableViewRowProxyItem.java:144)
11-29 12:32:19.927: E/AndroidRuntime(3412): at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:280)
11-29 12:32:19.927: E/AndroidRuntime(3412): at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:83)
11-29 12:32:19.927: E/AndroidRuntime(3412): at ti.modules.titanium.ui.widget.tableview.TiTableView$TTVListAdapter.getView(TiTableView.java:216)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.widget.AbsListView.obtainView(AbsListView.java:1435)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.widget.ListView.makeAndAddView(ListView.java:1824)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.widget.ListView.fillDown(ListView.java:689)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.widget.ListView.fillGap(ListView.java:658)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.widget.AbsListView.trackMotionScroll(AbsListView.java:3469)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.widget.AbsListView.onTouchEvent(AbsListView.java:2276)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.widget.ListView.onTouchEvent(ListView.java:3535)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.view.View.dispatchTouchEvent(View.java:3885)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
11-29 12:32:19.927: E/AndroidRuntime(3412): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1921)
11-29 12:32:19.927: E/AndroidRuntime(3412): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1196)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.app.Activity.dispatchTouchEvent(Activity.java:2155)
11-29 12:32:19.927: E/AndroidRuntime(3412): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1905)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2249)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.view.ViewRoot.handleMessage(ViewRoot.java:1933)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.os.Handler.dispatchMessage(Handler.java:99)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.os.Looper.loop(Looper.java:130)
11-29 12:32:19.927: E/AndroidRuntime(3412): at android.app.ActivityThread.main(ActivityThread.java:3859)
11-29 12:32:19.927: E/AndroidRuntime(3412): at java.lang.reflect.Method.invokeNative(Native Method)
11-29 12:32:19.927: E/AndroidRuntime(3412): at java.lang.reflect.Method.invoke(Method.java:507)
11-29 12:32:19.927: E/AndroidRuntime(3412): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:840)
11-29 12:32:19.927: E/AndroidRuntime(3412): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:598)
11-29 12:32:19.927: E/AndroidRuntime(3412): at dalvik.system.NativeStart.main(Native Method)
11-29 12:32:19.958: W/ActivityManager(499): Force finishing activity com.appc.test/._1bestpracticesActivity
11-29 12:32:20.106: D/dalvikvm(499): GC_EXTERNAL_ALLOC freed 1437K, 33% free 9328K/13767K, external 10097K/10227K, paused 90ms
11-29 12:32:20.122: W/ApplicationContext(499): Unable to create files directory
11-29 12:32:20.145: I/gralloc(499): Allocated 0x61663d64 size 2103800684
11-29 12:32:20.458: W/ActivityManager(499): Activity pause timeout for HistoryRecord{40bf7d68 com.appc.test/._1bestpracticesActivity}
11-29 12:32:20.505: D/ActivitityRenderTarget(917): onResume
11-29 12:32:20.520: W/IMGSRV(917): eglglue.c:778: InitContext: ignoring buffer type CBUF_TYPE_PDS_VERT_SECONDARY_PREGEN_BUFFER
11-29 12:32:20.528: I/gralloc(499): Allocated 0x660072 size 6488161
11-29 12:32:20.645: I/gralloc(499): Allocated 0x660072 size 6488161
11-29 12:32:20.716: I/gralloc(499): Allocated 0x660072 size 6488161
11-29 12:32:20.731: I/gralloc(499): Allocated 0x660072 size 6488161
Also other developers had similar issues: http://developer.appcelerator.com/question/123787/index-out-of-bound ; http://thompsonng.blogspot.de/2012/04/titanium-appcelerator-android-tableview.html But just removing the classname attribute causes our app to slow down very hard.
We fixed that problem. It may not be a bug but it would be nice if this could be documented better: When two rows have the same className they not only need to have the same subviews but also their subviews need to have the same subviews. The whole subview structure of a TableViewRow needs to be identical. The last thing might be logical but there are a lot of developers getting stuck with this. So maybe this could be documented well because the error message is not very helpful but logical when you know the error. Thanks!
@Markus Wutzler Can you please update this ticket with an actual sample? With a 100% runnable script we could diagnose a potential bug fix in order to get it resolved. I've been trying to reproduce it as per target environment stated above, but afraid I've been absolutely unable to replicate what you posted earlier. By using Kitchen Sink demos aren't accurate enough to narrow down this issue. Hope you can give us an update, the sooner the better.
I can't provide a full sample but it is really simple:
I didn't tried this but the error occurs even if the structure of child views is not the same. Bug occurred on Android. // EDIT: Maybe i can try to create a complete sample, but this could take some time.
@Markus Thanks for get back to this ticket, unfortunately I'm not quite sure to understand the latest snippet code posted by you. What it means "/Insert some random here/" on line 8? Can you go the following repo and test some [tableViews samples here](https://github.com/appcelerator/KitchenSink/tree/master/Resources/ui/common/baseui/table_*.js) Hopefully, it will replicate the problem and narrow down the *ArrayIndexOutOfBoundsException* Edit: Got another error, *tableView* is not even set at the latest sample. You might want to have a look at this guide about [Creating a Test Case](http://docs.appcelerator.com/titanium/latest/#!/guide/How_to_Submit_a_Bug_Report-section-29004732_HowtoSubmitaBugReport-CreatingaTestCase). Will reopen this ticket when a working sample got provided.
Okay, i edited my code snippet. now it should reproduce the error. The problem ist that every second list item diverges from the other one although each list item contains one view. but this view contains only one item on one view and two items on the next view. so the view structure is equal on the first level of the hierarchy but on the second level the view structure of all list items is not equal anymore.
This is the full sample that leads to the error. at least when you try to scroll on a device. As you see the subview structure is different on every second row although each row contains only a single view as first children. This might be logical in this small example but in a more complex exampl you loose overview very fast and this problem is nowhere documented.
@Markuz Thanks for providing a simple sample reproducing the problem. I was able to replicate on device. Notice that in the meantime the ticket was moved to Main Titanium project to dig into it.
See http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.TableViewRow-property-className A table view row must have a unique class name if the row layout is unique. You have two different view structures according to your example. So you need two different class names
As per the documentation,given test app is invalid.So closing the bug.