Hi,in my android application I want to render same window with different user data multiple times.My code structure looks like:
//app.js data:[ {title:"Row 1"}, {title:"Row 2"}, {title:"Row 3"}, {title:"Row 4"}, {title:"Row 5"} ] Ti.include('profile.js') profile_variables1.profile_dis1(username,data);
// profile.js var profile_variables1 = {}; (function(){ profile_variables1.profile_dis1 = function(username,data) { profile_variables1.userwin1 = Titanium.UI.createWindow( { backgroundColor:'#f8f8f8', }); feed_item_table = Ti.UI.createTableView( { width:Ti.Platform.displayCaps.platformWidth, backgroundColor:'transparent', separatorColor: '#ccc', hasChild:true, }); feed_item_table.setData(data); profile_variables1.userwin1.add(feed_item_table); profile_variables1.userwin1.open(); feed_item_table.addEventListener('click',function(e) { data:[ {title:"Row"+e.index}, {title:"Row"+e.index}, {title:"Row"+e.index}, {title:"Row"+e.index}, {title:"Row"+e.index} ] Ti.include('userinfo.js') user_dis1(username,data); }) } }();
(function(){ user_dis1 = function(username,data) { user_info1 = Titanium.UI.createWindow( { backgroundColor:'#f8f8f8', }); user_info1.open(); // display some data here...... table.addEventListener('click',function(e) { Ti.include('profile.js') profile_variables1.profile_dis1(username,data); } } }();In the above code I want to render same window with different data.more look like A-B-A-B-A-B.... It's working fine,My application display all window properly but allocated memory continuously growing.In main code of application I am also displaying image in every row.after few clicks my application closed forcefully; and error in debugger is out of memory error bitmap size exceeds VM budget. How to handle this situation.My application get closed because of this error.. Need help. Thank you.....
1 Answer
you will need to close your windows when you open the next one. clearing out the memory.
The way windows work is to stack them ontop of each other. so if you open a then b then a you will actually have 3 windows open. so you ned to open a then close a and open b then close b and open a.. if that makes sense.
This also means that to use the back button you will have to capture the android:back event and build your own back handler functionality.
Hope this helps
t.
Your Answer
Think you can help? Login to answer this question!