open 2 windows in android

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

Hi, in my android app i need to open 2 windows, but when i open the second window like i do in iOs, the old window still remains in foreground! this is my code:

var win= Ti.UI.createWindow({
 
});
 
var button = Ti.UI.createButton({
top:'auto',
bottom:'auto',
left:'auto',
right:'auto'
});
 
bottone_aggiungi.addEventListener("click",function(e){
 
var new_win= Ti.UI.createWindow({
 
});
 
new_win.open();
 
win.open();
When i click on the button the new window opens but the old window still remains in foreground and if i do new_win.close(); i close everything! Does somebody know why?thanks

2 Answers

Accepted Answer

Hi Raffaele,

Try to open in modal window.

var new_win= Ti.UI.createWindow({
 
});
new_win.open({
        modal : true
    });

— answered 11 months ago by Nitin Chavda
answer permalink
2 Comments
  • thank you very much but out of my window everything is black do you know how to change this color? i used Titanium.UI.setBackgroundColor('white'); but it still remains black

    — commented 11 months ago by Raffaele Chiocca

  • Okay set below code

    var new_win= Ti.UI.createWindow({
     backgroundColor:'white'
    });
     
    new_win.open({
            modal : true
        });

    — commented 11 months ago by Nitin Chavda

in win Eventlistener you have to open new_win.open() and close the current window i.e win.close() and vice - versa .

Your Answer

Think you can help? Login to answer this question!