Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2812] ScrollabeView inside TableView crashes regularly after scrolling

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-08-28T11:41:37.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, defect, reported-1.5.1
ReporterNariman
AssigneeNeeraj Gupta
Created2011-04-15T03:30:10.000+0000
Updated2017-03-10T18:18:27.000+0000

Description

Getting this exception regularly after adding a ScrollableViews (which works, before the exception) to TableView rows:

    var view1 = Titanium.UI.createView();
    view1.add(thisLabelTitle);
    var view2 = Titanium.UI.createView({backgroundColor:'#456'});
    view2.add(thisLabelDesc);
    var scrollView = Titanium.UI.createScrollableView({
        views:[view1,view2]
    });         

    thisRow.add(scrollView);            
    tableData.push(thisRow);

java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:1970)
at android.view.ViewGroup.addView(ViewGroup.java:1865)
at android.view.ViewGroup.addView(ViewGroup.java:1822)
at android.view.ViewGroup.addView(ViewGroup.java:1802)
at ti.modules.titanium.ui.widget.TiScrollableView$ViewWrapper.doAttachView(TiScrollableView.java:72)
at ti.modules.titanium.ui.widget.TiScrollableView.setViews(TiScrollableView.java:371)
at ti.modules.titanium.ui.widget.TiUIScrollableView.processProperties(TiUIScrollableView.java:41)
at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.refreshControls(TiTableViewRowProxyItem.java:134)
at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:243)
at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:76)
at ti.modules.titanium.ui.widget.tableview.TiTableView$TTVListAdapter.getView(TiTableView.java:202)
at android.widget.AbsListView.obtainView(AbsListView.java:1294)
at android.widget.ListView.makeAndAddView(ListView.java:1727)
at android.widget.ListView.fillDown(ListView.java:652)
at android.widget.ListView.fillGap(ListView.java:623)
at android.widget.AbsListView.trackMotionScroll(AbsListView.java:2944)
at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:2485)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)

Comments

  1. hal 2011-04-15

    It is quite clear that you haven't read the http://developer.appcelerator.com/guides/en/contribute.html">Contribute guide before raising this ticket. It is crucial that you follow the procedure that it explains, or else you simply increase the work-load of the core devs and reduce their time spent resolving issues.

    Please edit this ticket to include the minimum-required information, otherwise you risk it being marked invalid.

  2. Nariman 2011-04-15

    https://gist.github.com/777402">https://gist.github.com/777402

    Android 2.2
    Titanium SDK 1.5.1
    Titanium Developer 1.2.2

  3. hal 2011-04-15

    Nariman - although I haven't tested your code, your new usecase sets a good example for others. Thanks for updating!

    Adding reported tag, as per guidelines.

  4. Junaid Younus 2012-08-28

    Tested on a Samsung Galaxy S2 using TiSDK 2.2.0v20120824175712, unable to reproduce the issue. Ticket marked as resolved.
  5. Lee Morris 2017-03-10

    Closing ticket as the issue cannot be reproduced.

JSON Source