[TIMOB-630] Android: TabGroup stops window being re-shown
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Won't Do |
Resolution Date | 2018-08-02T17:06:41.000+0000 |
Affected Version/s | Release 1.7.2, Release 2.0.1, Release 3.0.0, Release 3.2.0 |
Fix Version/s | n/a |
Components | Android |
Labels | exalture |
Reporter | Jon Alter |
Assignee | Ingo Muschenetz |
Created | 2011-04-15T02:33:13.000+0000 |
Updated | 2018-08-02T17:08:41.000+0000 |
Description
start with a standalone window that fires an event, a listener
in app.js then closes the window and opens a tabgroup (think logon
window) - all good.
the tabgroup fires an event which is listened to in app.js which
closes the tabgroup and opens the initial window. This fails - the
tabgroup goes away, logging shows the original window is being
re-built, but it is never shown. It is shown in iPhone.
Pseudo code for app.js...
var loginWin;
var logoutGroup;
function makeLoginWindow() {
loginWin = window with single button firing LOGIN event;
loginWin.open();
}
function makeLogoutWindow() {
logoutGroup = tabGroup containing one window with...
single button firing LOGOUT event;
logoutGroup.close();
}
makeLoginWindow()
addEventListener(LOGIN) {
loginWin.close();
makeLogoutWindow();
}
addEventListener(LOGOUT) {
logoutGroup.close();
makeLoginWindow();
}
* Should this work?
* Should I raise this sort of thing as a query or ask in the forums in future?
Attachments
File | Date | Size |
---|---|---|
testi.zip | 2011-04-15T02:33:14.000+0000 | 1396 |
I can confirm that this issue still exists on android, using latest builds of both 1.4.X and 1.5 master dated 6th Nov 2010, tested via the android emulator on ubuntu.
There is another ticket describing this, or a very similar, issue at https://appcelerator.lighthouseapp.com/projects/32238-titanium-mobile/tickets/2015">#2015. Hence, maybe this ticket can be closed as a duplicate.
Deleted by poster
When the tabGroup closes, the windows loose their event listeners. Step 1: run the code below Step 2: click the login button Step 3: click the logout button Step 4: click the login button again (notice that it does not work this time because the eventListener has gone missing)
Tested with
TiSDK 1.7.2 Android Emulator 2.2Associated Helpdesk Ticket
http://appc.me/c/APP-448628@Jon, could you please provide me an working example of the workaround. I don't seem to manage to make it work. And it's pretty urgent :( Thank you.
After more testing, the workaround is not reliable. I am removing it from the ticket.
FYI. bug is still present within 1.8.1 Android. Works as expected in iOS 1.8.1.
Tried it with 2.0.1GA2 on a Samsung Galaxy S2 (2.3.6) and the issue still exists. If you keep pressing login/logout, the app will eventually crash. Works fine on the iOS simulator.
Not able to reproduce the bug anymore on 2.1 latest CI build. Marking as closed.
Tested the code with a Samsung Galaxy S3, TiSDK 2.2.0v20120810194112, TiStudio 2.1.1.201207271312 and the app crashes when I press the 'log out' button. This is the ddms output:
With heavyweight windows, each window (or TabGroup) corresponds to an activity and to launch an activity, current activity is needed. Closing the current window before opening the new window makes the current activity inaccessible and hence the crash. I think changing the order by opening the new window and closing the old one will work. Something like tabGroup.open(); master.close();
Cleaning up old tickets. If this is still requested, please reopen.