Close a Window after a new Window is fully loaded
When I use:
newWindow.open();
currentWindow.close();
There is a split second of black on my Android device as one window closes and the other opens. Is there a way I can listen for newWindow to completely load before closing currentWindow?
Thanks!
4 Answers
-
Accepted Answer
Windows cannot be "removed" only "closed".
You could try to add a small delay when you close the window.
newWindow.open(); setTimeout( function(){ the_win_to_be_closed.close(); } , 100)
-
This is pretty much the same problem I posted about earlier today, just on iphone. Can someone hop in here and explain removing windows from the hierarchy? What page in kitchensink calls .remove() on a window? Because I can't find it. And when I call a window to be removed the app just flat out crashes. I know there are other posts about closing multiple windows but that does not seem to be working for many people.
-
You shouldn't need to automatically call remove on a window most of the time - Titanium will clean that up for you. Windows are really best used for hierarchical navigation with a clear forward/back navigation mechanic. If you need to skip back and forth between a collection of screens, a stack of views is usually a better choice.
-
I'm not trying to call a .remove I'm calling a .close. I will try doing to the timeout function and see how that works.
Thanks.