tags:

views:

171

answers:

1

Hi, I followed the tutorial "Tab Layout" and i created my TabActivity with some tab, in particular i have a tab called "newTab" with a button and i want to add a new tab when i press it.

If i implement the OnClickListener in the newTab Activity i don't know how to call the tabHost.addTab() method because it is a TabActivity method, and if i implement the OnClickListener in the TabActivity i don't know how to assign the button event to it... so how can i do it?

Tnk's All

+1  A: 
this.getTabHost().addTab(...)
Pentium10
The problem is that it doesn't go because i'm in a normal Activity when i receive the event
Skatephone
How is that, you mentioned you extended TabActivity? Did you use that `extends TabActivity` ?
Pentium10
Yes but the content of the tab (and the button) is in a Activity Class
Skatephone
Post the codes where you define your tabs, and where you want to use them. Edit your original question.
Pentium10
I resolved using a menùtnk's :D
Skatephone