Android Question How Get Name TabStrip page by index

netsistemas

Active Member
Licensed User
Longtime User
how get the name (text) in tab page in tabStrip control by index.?
 

mc73

Well-Known Member
Licensed User
Longtime User
Haven't used this lib, but you can create a list containing the tab page names upon creation.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
how get the name (text) in tab page in tabStrip control by index.?
Something like this:
B4X:
Dim l As List
    l.Initialize
    l.AddAll(GetAllTabLabels (tabstrip))
    For i=0 To l.Size-1
        Dim v As Label = l.Get(i)
        Log(v.Text)  'display label name
    Next    
  
Public Sub GetAllTabLabels (tabstrip As TabStrip) As List
    Dim jo As JavaObject = tabstrip
    Dim r As Reflector
    r.Target = jo.GetField("tabStrip")
    Dim tc As Panel = r.GetField("tabsContainer")
    Dim res As List
    res.Initialize
    For Each v As View In tc
        If v Is Label Then res.Add(v)
    Next
    Return res  
End Sub
 
Upvote 0
Top