Hello all,
I need your help with my application design. I am designing an
application with 4 tabs (using tabhost ..etc). The 4 tabs will be
identical in terms of layout (text views, buttons..etc) Except that
the texts and color are different from a tab to another. Tab 1 feeds
info to Tab2 and so on. How do you suggest I go about it? I will tell
you what I am thinking of doing and PLEASE correct me before I start
as I am sure you guys are way more experienced than me :)
-Create layout.xml that has the layout design such as text views,
buttons ..etc
-In Java, I would create ONE activity for the whole thing and set the
the xml file as the content for each tab meaning that I would do
something like that
th.setup();
for(int i = 1; i<5; i++){
TabSpec specs = th.newTabSpec("Tab"+i);
specs.setContent(R.id.layout);
specs.setIndicator("Tab"+i);
th.addTab(specs);
}
- I have a static variable (hash table or array) that contains the
values of all the tabs so that everytime a tab is clicked, I load it
layout with the correct text values and I set the background
appropriately.
Does this sound right?
Ideally, I wouldve preferred if I can set the content of each tab and
then be able to get access to each tab and updates the values there.
So that when the tab is requested the values are there but I don't
think there is a way I can do especially with the fact I am using the
same layout (meaning same IDs for its elements) for all the tabs
Any recommendations?
Thanks
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en