Titanium Community Questions & Answer Archive

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

How can I open another window after closing a tabGroup?

Now, I create Android Application and I want to show a View after closing a tabGroup.
Please tell me how I can do it?

— asked November 9th 2010 by masa ochi
  • android
  • tabgroup
  • what code have your written so far? Please post it.

    — commented November 9th 2010 by Aaron Saunders
  • It really depends what you want to achieve, masa - there are a number of scenarios.

    Talk us through how your application works (in terms of windows and views) from the app.js upwards and maybe someone can suggest an approach you could take.

    As Aaron rightly questioned, where is your code?

    — commented November 9th 2010 by Paul Dowsett

3 Answers

  • Accepted Answer


    Once a tabgroup is open, it cannot be closed, due to this ticket. If it is closed, on android anyway, you just see a black blank screen, and you cannot recover from it.

    If you create and open a window, then the new window will appear in the active tab (even though it has not been added as a tab to the group), with the tabgroup navigation showing above.

    If you set the navBarHidden: true property on that window and then open it, it will fill the whole screen covering the tabs.

    Hope this helps

    — answered November 10th 2010 by Paul Dowsett
  • // Define the Window
    var win = Titanium.UI.createWindow({
    var view1 = Titanium.UI.createView({ /*.....*/});
    var view2 = Titanium.UI.createView({ /*.....*/});
    var button = TItanium.UI.createButton{( /*.....*/});
    var tabGroup = Titanium.UI.createTabGroup();
    var win1 = Titanium.UI.createWindow({ /*.....*/});
    var tab1 = Titanium.UI.createTab({ 
     window: win1,
    var win2 = Titanium.UI.createWindow({ /*.....*/});
    var tab2 = Titanium.UI.createTab({ 
     window: win2,
    if (Titanium.Platform.name == 'iPhone OS'){
    button.addEventListener('click', function(){
    tabGroup.addEventListener('close', function(e){
    — answered November 10th 2010 by masa ochi
    1 Comment
    • Masa

      This is not an answer - you should either edit/update your original question, or post it as a reply comment to one of the requests for more info.

      — commented November 10th 2010 by Paul Dowsett
  • The "navBarHidden: true" worked!
    Thank you Hal H!!

    Actually, after open a new window, I want to use "android:back" like this.

    win.addEventListener('android:back', function(e){
        return false;

    But it doesn't work.
    What should I do?

    — answered November 11th 2010 by masa ochi
    • If you want to use android:back you should use SDK 1.5

      — commented November 11th 2010 by Jacob van Dam
    • SDK 1.5.0 didn't work.

      — commented November 11th 2010 by masa ochi
    • I asked in here.

      — commented November 11th 2010 by masa ochi
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.