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
Sub RemovePage(ts As TabStrip, Index As Int) As Panel
If ts.CurrentPage >= Index Then ts.ScrollTo(0, False)
Dim jo As JavaObject = ts
Dim p As Panel = jo.GetFieldJO("pages").RunMethod("remove", Array(Index))
jo.GetFieldJO("titles").RunMethod("remove", Array(Index))
RefreshTabStrip (ts)
Return p
End Sub
Sub RefreshTabStrip(ts As TabStrip)
Dim jo As JavaObject = ts
jo.RunMethod("resetAdapter", Null)
jo.GetFieldJO("vp").RunMethodJO("getAdapter", Null).RunMethod("notifyDataSetChanged", Null)
jo.GetFieldJO("tabStrip").RunMethod("notifyDataSetChanged", Null)
End Sub