Sub Globals
Dim btn As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim sd As StateListDrawable
sd.Initialize
Dim bd1, bd2 As BitmapDrawable
bd1.Initialize(LoadBitmap(File.DirAssets, "x.jpg")) 'change to images you include in your project
bd2.Initialize(LoadBitmap(File.DirAssets, "icon.jpg"))
sd.AddState(sd.State_Pressed, bd2)
sd.AddCatchAllState(bd1)
'the following two lines are not needed if the button is added with the designer
btn.Initialize("btn")
Activity.AddView(btn, 10dip, 10dip, 200dip, 200dip)
btn.Background = sd
End Sub