window.close() for back buttons

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

Hi,

When I do back button click, I am closing the current window to show the previous window. For the back button I just close the window.

The previous window takes some time to get displayed. I can see a transition for 1 to 2 seconds with a background color of the application. How this can be fixed?

Also I heard about exitOnClose. Is it a useful one

— asked 11 months ago by Rebin Joseph
8 Comments
  • Are you developing for android or iOS (or both)? I'm guessing you mean android.

    You really shouldn't have to explicitly handle the "back" button in android. Can you show some code samples?

    — commented 11 months ago by Jason Priebe

  • I develop both app

    I have a back button.
    I just do this. I have window for each js file in the application

    backBtnAppointmentDetail.addEventListener('click', function(e){

    var appointmentWin = Titanium.UI.createWindow(admn);
    

    });

    — commented 11 months ago by Rebin Joseph

  • Some thoughts:

    • you don't really want to have a separate js file for each window; instead, you want to build your windows as CommonJS modules and then require() them into your code

    • the way you open windows is very important. If you're using a TabGroup, for example, you need to open the windows via the active tab in the tab group.

    — commented 11 months ago by Jason Priebe

  • Show 5 more comments

Your Answer

Think you can help? Login to answer this question!