Closing application on Android

You must Login before you can answer or comment on any questions.

I have an app that works fine on the iPhone, but using Android's default tabgroup and navbar was just too ugly!

So I dumped the tabgroup in favour of a couple of extra buttons on the homescreen and open every window fullscreen, navbar hidden and then create my own navbar image.

The problem is using the back button to go back through the windows does not exit the app from the homescreen, it brings up a blank page.

Does anyone know how to reference this page and close it?

Many thanks

Des

From app.js :-

var win1 = Titanium.UI.createWindow({  
    url:'home.js',
    fullscreen:true,
    navBarHidden:true,
    backgroundColor:'#fff'
});

2 Answers

Accepted Answer

Set the property 'exitOnClose' to true for the window you want to be the last in the stack and it'll close the app when the user hits the back button when that window is active.

Many thanks for the quick reply, it worked perfectly.

I am begining to regain faith in Titanium for Android ;-)

— answered 3 years ago by Derrick Huth
answer permalink
1 Comment
  • I also noticed that if you don't set the fullscreen property on your first window (at all) you will achieve this effect. Anyone know why? If i set fullscreen to false I see the blank screen as well.

    This exits correctly:

    var win1 =  Titanium.UI.createWindow({  
        navBarHidden:true,
        backgroundColor:'#fff'
    });
    This doesn't:
    var win1 =  Titanium.UI.createWindow({  
        navBarHidden:true,
        backgroundColor:'#fff',
        fullscreen : false
    });

    — commented 2 years ago by John Kalberer

Your Answer

Think you can help? Login to answer this question!