Tabhost does not react to change

grafsoft

Well-Known Member
Licensed User
Longtime User
Hi,
this code does not work:

Sub Globals
Dim th As TabHost
...
end sub

...
th.Initialize ("TabChanged")
Activity.AddView(th, 0, 0, 98%x, 98%y)
...


Sub TabChanged(tabname As String)
' the program never gets here
end sub

I can also submit the whole project ...

thanks
Peter
 

yttrium

Active Member
Licensed User
Longtime User
Hi,
this code does not work:

B4X:
Sub Globals
Dim th As TabHost
...
end sub

...
th.Initialize ("TabChanged")
Activity.AddView(th, 0, 0, 98%x, 98%y)
...

Sub TabChanged(tabname As String)
' the program never gets here
end sub

I can also submit the whole project ...

thanks
Peter
I think your initialization line should look like:
B4X:
th.Initialize ("th")
and your TabChanged:

B4X:
Sub th_TabChanged(tabname As String)
End Sub
 
Last edited:
Upvote 0

grafsoft

Well-Known Member
Licensed User
Longtime User
Thanks, but in both cases I get "sub th_Tabchanged" (or Tabchanged_Tabchanged) signature does not match expected signature.
 
Upvote 0
Top