I need to instead set the [button] item background color, text color and tooltip text (each with different values).
Seems the function would start with this:
B4X:
Sub SetStyleAndTooltip(SegmentedButton As SegmentedButton, Index As Int, ?? As ??)
Dim ToggleButton As JavaObject = SegmentedButton
ToggleButton = ToggleButton.RunMethodJO("getButtons", Null).RunMethod("get", Array(Index))
ToggleButton.RunMethod("set?", Array(??))
ToggleButton.RunMethod("set?", Array(??))
ToggleButton.RunMethod("set?", Array(??))
End Sub
Sub SetStyleAndTooltip(SegmentedButton As SegmentedButton, Index As Int)
Dim JO As JavaObject = SegmentedButton
Dim btn As B4XView = JO.RunMethodJO("getButtons", Null).RunMethod("get", Array(Index))
btn.Color = xui.Color_Red
Dim ctl As Control = btn
ctl.TooltipText = "tool tip"
End Sub