[TIMOB-2696] Andoird: inital tab opened even if not active when call tabgroup.open
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-04-15T03:27:18.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Sprint-2011-09 |
Components | Android |
Labels | android, defect, klist, release-1.7.0, reported-1.5.1, reported-1.6.0, rplist |
Reporter | Eddie Loeffen |
Assignee | Don Thorp |
Created | 2011-04-15T03:27:16.000+0000 |
Updated | 2017-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
File | Date | Size |
---|---|---|
setactivetabsamplecode.zip | 2011-04-15T03:27:17.000+0000 | 1041 |
setactivetabtracelog.rtf | 2011-04-15T03:27:17.000+0000 | 29935 |
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
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
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.
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.
Closing as invalid.