I’m trying to add native tabs to my phonegap application on Android.
I have a way of doing it where each tab has it’s own Activity and use loadUrl to load Phonegap in the view but it raises two problems.
- I’m afraid the app is going to be
awfully slow if I have 5 tabs each
running Phonegap with some
javascript. - If I go back to a tab,
the last instance state has been
saved, so if i clicked on a link
from the tab, clicking back on the
tab doesn’t load back the main page.
I’m thinking about creating a layout main.xml with a custom linear layout and some callback buttons to call something like : super.loadUrl(“javascript: goTo page rand;”); but I’m not sure this is the best way since I would have to rewrite the tabs functionality and design.
Thanks !
Do you really need the tabs to be native because of some architectural constraint? If not how about using a framework like Sencha Touch which provides tab UI controls? There’s a demo in the kitchensink code:
http://dev.sencha.com/deploy/touch/examples/kitchensink/
The framework works pretty well from what I’ve seen inside of Phonegap.