Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2696] Andoird: inital tab opened even if not active when call tabgroup.open

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2011-04-15T03:27:18.000+0000
Affected Version/sn/a
Fix Version/sSprint-2011-09
ComponentsAndroid
Labelsandroid, defect, klist, release-1.7.0, reported-1.5.1, reported-1.6.0, rplist
ReporterEddie Loeffen
AssigneeDon Thorp
Created2011-04-15T03:27:16.000+0000
Updated2017-03-02T18:16:39.000+0000

Description

sample of my code:

tabGroup.addTab(tabSession);
tabGroup.addTab(tabResults);
tabGroup.addTab(tabMessages);
tabGroup.addTab(tabNews);
tabGroup.addTab(tabSettings);

tabGroup.setActiveTab(4);
tabGroup.open();

tabSettings is opened as expected, but tabSession is opened too. This breaks my application as when tabSession opens it downloads a list. This list is then put into tabSettings instead of tabSession because it is the active window.

What I expected, and what happens in iOS, is that tabSettings is opened initially, and tabSession is not, until you click the Sessions tab

this is in Titanium Mobile 1.5.1

Attachments

FileDateSize
setactivetabsamplecode.zip2011-04-15T03:27:17.000+00001041
setactivetabtracelog.rtf2011-04-15T03:27:17.000+000029935

Comments

  1. Dawson Toth 2011-04-15

    I have replicated this issue. To be more precise, and to help get it fixed swiftly:

    Problem

    Given a not-yet-opened tabGroup, and two tabs (tab1, tab2), tabGroup.setActiveTab(tab2) will cause both tabs to be loaded, and can result in the tabs contents getting loaded into the same view*.

    *Tab contents will only load into the same view if you load a lot of data in the window. If the load is quick enough, the misbehavior will not be observed. I was able to reproduce the stacking every time by putting several hundred labels in both of my tabs.

    Expected Behavior

    Calling tabGroup.setActiveTab(tab2) would cause tab1 to not be loaded until the user clicks it. Further, tab1 should not load on top of tab2.

    Tested On

    Tested on clean builds of Titanium Mobile 1.5.1, and 1.6.0 from Jan 11th 2011.
    BROKEN on Android Simulator 2.2
    BROKEN on Android Device Samsung Epic 4G 2.1

    Sample Code

    Attached.

    Trace Log

    Attached.

    Associated Helpdesk Ticket

    http://developer.appcelerator.com/helpdesk/view/65201">http://developer.appcelerator.com/helpdesk/view/65201

  2. Jon Alter 2011-04-15

    there's another customer interested in this fix

    Associated Helpdesk Ticket

    http://developer.appcelerator.com/helpdesk/view/72451">http://developer.appcelerator.com/helpdesk/view/72451

  3. Don Thorp 2011-04-15

    We'll look into this, but depending on OS controls loading/pre-loading behavior to not change is asking for trouble. The double loading should not occur though.

  4. Opie Cyrus 2011-04-15

    This behavior is actually core behavior in terms of how Android OS handles tabs currently.

    To get around the original problem, the logic for downloading the list in question should be driven via an app event once whatever logic (such a login) has completed in the desired active tab rather than just launching due to the tab opening.

  5. Lee Morris 2017-03-02

    Closing as invalid.

JSON Source