Hi.. In my app I'm trying to implement a logout function. The structure of app is that we login from index.js and call a controller called home.js and from home.js I call menu.js where logout function is placed. Now the problem is that when the logout function is called, the data is cleared and returned to index page, but if we click back button it is returned to home.js as it is not closed. How to close the home controller when logout function is called? The main issue is that home controller cannot be closed when the menu is called, as if the user cancels menu option it should return to previous state.
Here is my code
In index I call home page. index.js
var win=Alloy.createController('home',response).getView().open();From home page i call menu like this home.js
var win=Alloy.createController('menu',args).getView(); win.open({ activityEnterAnimation : Ti.App.Android.R.anim.slide_out_left, });In menu page in logout function i call this menu.js
function logout(e){ $.menu.close(); Ti.App.Properties.setString('username',null); Ti.App.Properties.setString('password',null); var win=Alloy.createController('index').getView().open(); }I need here to close the opened controller home.js in logout() function. Please help me.