Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Layout1")
addstatelist(EditText1)
addstatelist(EditText2)
addstatelist(EditText3)
End Sub
Sub addstatelist(edt As EditText)
Dim jo As JavaObject = edt
jo.RunMethod("setFocusableInTouchMode",Array As Object(True))
jo.RunMethod("setFocusable",Array As Object(True))
Dim focused, pressed, selected, disabled, enabled As ColorDrawable
focused.Initialize2(Colors.Gray,5dip, 2dip, Colors.Black)
pressed.Initialize2(Colors.DarkGray,5dip, 2dip, Colors.Blue)
selected.Initialize2(Colors.Yellow,5dip, 2dip, Colors.Magenta)
disabled.Initialize2(Colors.DarkGray,5dip, 2dip, Colors.Red)
enabled.Initialize2(Colors.Black, 5dip, 2dip, Colors.Green)
Dim sld As StateListDrawable
sld.Initialize
sld.AddState(sld.State_Focused, focused)
sld.AddState(sld.State_Pressed, pressed)
sld.AddState(sld.State_Selected, selected)
sld.AddState(sld.State_Disabled, disabled)
sld.AddState(sld.State_enabled, enabled)
edt.Background = sld
End Sub