I use this part of class "TabStripViewPagerExtendet" to instert and delete pages :
i use a map to know pages deletes and insert pages using a empty index.
but is possible know a empty index positions ????
B4X:
Public Sub InsertPage (tabstrip As TabStrip, Index As Int, Page As Panel, Title As String)
Dim jo As JavaObject = tabstrip
jo.GetFieldJO("pages").RunMethod("add", Array(Index, Page))
jo.GetFieldJO("titles").RunMethod("add", Array(Index, Title))
RefreshTabStrip(tabstrip)
End Sub
Public Sub RemovePage (tabstrip As TabStrip, Index As Int) As Panel
If tabstrip.CurrentPage >= Index Then tabstrip.ScrollTo(0, False)
Dim jo As JavaObject = tabstrip
Dim p As Panel = jo.GetFieldJO("pages").RunMethod("remove", Array(Index))
jo.GetFieldJO("titles").RunMethod("remove", Array(Index))
RefreshTabStrip (tabstrip)
Return p
End Sub
i use a map to know pages deletes and insert pages using a empty index.
but is possible know a empty index positions ????