Sub SetUpOnFocusListener(Button As Button, EventName As String)
Dim JO As JavaObject = Button
Dim event As Object = JO.CreateEvent("android.view.View.OnFocusChangeListener",EventName,False)
JO.RunMethod("setOnFocusChangeListener",Array As Object(event))
End Sub
Sub Help_Event(MethodName As String, Args() As Object)
Dim btn As Button
btn = Sender
Log("Button has focus: " & Args(1)) 'Args(1) is True if button has focus, false otherwise.
If Args(1)= True Then
btn.Color = xui.Color_Blue
Else
btn.Color = xui.Color_DarkGray
End If
End Sub