-1

I'm writing an Android app using Titanium Alloy.

This app has multiple View files and it is based on a lot of Windows elements.

Just for making a simple example, think about this:

I have two View files: index.xml (with its Controller index.js) and win02.xml (with its Controller win02.js). index.xml has a Button. I want to open win02 from index by pressing its Button and I want everything about index to be removed from memory so I avoid possible memory leaks.

Inside index.js, I put this code:

btn.addEventListener('click', function(e){
   Alloy.createController('win02').getView().open();     
});

And, in doing so, I am able to open the win02 Window. But how can I totally remove index? Thanks.

logic
  • 1,739
  • 3
  • 16
  • 22

1 Answers1

0

To remove a window you can call close() so $.index.close(); just after you create win02, that should do the trick.

Liam MacDonald
  • 301
  • 1
  • 9