Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Navigating back and forth between windows in iphone

Hey all,

I'm having trouble with window navigation in iphone. In android it's easy, I open a new window and then close the current one:

var win = Ti.UI.currentWindow;
var newWindow = new Window({ url: "myurl.js", title: "mytitle" });
newWindow.open();
win.close();

However in iphone this doesn't work, it opens the new window for a second and then it closes.

I've tried capturing the current window close event and opening the new window in there and have also tried using a settimeout and waiting a second after closing the current window to open the new window but to no avail, it still closes the new window after a second. The last thing I tried was opening all of my windows on app load and then switching between them with a custom app event that calls .hide() and .show() on each window to toggle visibility, but it seems that these methods don't do anything.

So how do you switch back and forth between windows in iphone?? Help!!

— asked November 24th 2010 by Justin Toth
  • iphone
0 Comments

2 Answers

  • not sure but could it be that because win is the current window, when you oopen newWindow, newWindow becomes the current window so your win.close closes newWindow? try changing win from currentWindow to a defined window.

    im new to this so i may be way off base

    — answered November 24th 2010 by sean oreilly
    permalink
    0 Comments
  • i don't understand your question 100% but any way check Ti.UI.NavigationGroup

    — answered November 24th 2010 by mostafa farghaly
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.