Sub Process_Globals
End Sub
Sub Globals
Dim TabHost1 As TabHost
Dim Label1 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("LayoutMain")
' add some tabs to the TabHost
Dim i As Int
For i=0 To 3
TabHost1.AddTab("Tab#"&i, "LayoutTab")
Label1.Text="This is tab#"&i
Next
' create a GradientDrawable to use as the TabIndicator background
Dim MyGradient As GradientDrawable
Dim Clrs(2) As Int
Clrs(0)=Colors.Red
Clrs(1)=Colors.Yellow
MyGradient.Initialize("TOP_BOTTOM", Clrs)
' apply the GradientDrawable to each TabIndicator
Dim Reflector1 As Reflector
Dim TabIndex, TabCount As Int
Dim TabWidget As Object
Reflector1.Target=TabHost1
TabWidget=Reflector1.RunMethod("getTabWidget")
Reflector1.Target=TabWidget
TabCount=Reflector1.RunMethod("getTabCount")
Dim TabIndicator As View
For TabIndex=0 To TabCount-1
TabIndicator=Reflector1.RunMethod2("getChildAt", TabIndex, "java.lang.int")
TabIndicator.Background=MyGradient
Next
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub