Hi Im working on an android app with tabgroup. The problem is that i want to keep the tab visible even if opening a new window from within a tabs window.
I have tried using both heavyweight and lightweight window but the problem is:
Lightweight window: Back button makes the app close. It should go back to the previous window
Heavyweight window: Opens over the entire screen. Tabgroup is hidden. I have tried to use settings with top and height/width, but it seems like Heavyweight window always use the whole screen.
So what do i do ? Lightweight messes up the back navigation and heavyweight hides the tabgroup.
Please help
Thanks
Tom
4 Answers
Accepted Answer
What win variables? I think you need to maintain a global window stack if you want the ability to jump to home page
You need to listen for the android: back event and determine what action to take.
Also look at the documentation on exitOnClose
Hmmm. Maybe i got the fix
I create a lightweight window and have a event listener. on the back button. From the previous window i opened i send the parentid, and so i first when the back button is clicked i just create a new window and close the one im in.
var win = Titanium.UI.currentWindow; win.addEventListener('android:back', function(e){ var contentwindowm = Titanium.UI.createWindow({ url:'android.js', height:win.height, width:win.height, title:win.title, id:win.id, type:win.type, content:win.content, parent:win.parent, backgroundColor:win.backgroundcolor, backgroundimage:win.backgroundimage, companyID:win.companyID }); win.close(); //close the window that you where in contentwindowm.open(); // open the new window });It seems like its working, but if any1 got any input on maybe this is not a good method i would appreciate it.
Thanks
Tom
Hi. Yeah i wanted to jump back to the parent page/window. Tried to set the parent as a global variable and update it on onclick opening the page., but it seems like when the eventlistener fires with back click i only get the id of the first window.
Hmm. a little stuck here again.
Thanks
Tom
Your Answer
Think you can help? Login to answer this question!