Public Sub AddToParent(Parent As Panel, Left As Int, Top As Int, Width As Int, height As Int, left2 As Int, top2 As Int, width2 As Int, height2 As Int)
Parent.AddView(et, 50dip, -1dip, 265dip, 50dip)
Parent.AddView(lv, left2, top2, width2, height2)
SetNinePatchButton(et, "apptheme_textfield_default_holo_light", "apptheme_textfield_activated_holo_light")
End Sub
Sub SetNinePatchButton(Btn As EditText, DefaultImage As String, PressedImage As String)
Dim r As Reflector
Dim package As String
Dim idDefault, idPressed As Int
package = r.GetStaticField("anywheresoftware.b4a.BA", "packageName")
idDefault = r.GetStaticField(package & ".R$drawable", DefaultImage)
idPressed = r.GetStaticField(package & ".R$drawable", PressedImage)
r.Target = r.GetContext
r.Target = r.RunMethod("getResources")
Dim sd As StateListDrawable
sd.Initialize
sd.AddState(sd.State_Pressed, r.RunMethod2("getDrawable", idPressed, "java.lang.int"))
sd.AddCatchAllState( r.RunMethod2("getDrawable", idDefault, "java.lang.int"))
Btn.Background = sd
End Sub