Sub et_EnterPressed
Dim editer As EditText
editer = Sender
Dim jo As JavaObject
jo.InitializeContext
jo = edittext
Dim hasfocus As Boolean = jo.RunMethod("hasFocus",Null)
Log(editer.Tag & " hasfocus: " & hasfocus)
End Sub
Sub et_FocusChanged (HasFocus As Boolean)
Dim editer As EditText
editer = Sender
Dim jo As JavaObject
jo.InitializeContext
jo = edittext
Dim HasFocus As Boolean = jo.RunMethod("hasFocus",Null)
Log(editer.Tag & " hasfocus: " & HasFocus)
End Sub
so, there appears to be a method called hasFocus() that's part of android's View class. i used a java object to get at it. it seemed to work ok.
if you only have 1 edittext view, then you don't need:
Dim editer As EditText
editer = Sender
this part. (and, of course, you wouldn't need to reference the tag property. if you have multiple edittext views and you wanted to know which one had the focus, you would populate the tag property and then refer to it in the enter_press and/or focus_changed subs.
as i say, i tested it briefly, and it seemed happy. when i tapped the edittext to get its attention, it triggered true. when i tapped the enter key, it said true (of course, you wouldn't use the force_enter_key option unless the edittext was single line, which, in my case, it was)