Have you tried the posted solution?
I've tested it, and it works:
B4X:
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private EditText1 As EditText
Private EditText2 As EditText
Private EditText3 As EditText
Private EditFocus As EditText
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
EditText1.Tag = "EditText1"
EditText2.Tag = "EditText2"
EditText3.Tag = "EditText3"
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub Button1_Click
xui.MsgboxAsync("The focus is on " & EditFocus.Tag, "Focus")
End Sub
Private Sub EditText_FocusChanged (HasFocus As Boolean)
If HasFocus Then
EditFocus = Sender
Else
EditFocus = Null
End If
End Sub
Sub Button1_Click
If EditText1.As(JavaObject).RunMethod("hasFocus", Null) = True Then
Log("EditText1 has focus")
Else If EditText2.As(JavaObject).RunMethod("hasFocus", Null) = True Then
Log("EditText2 has focus")
Else If EditText3.As(JavaObject).RunMethod("hasFocus", Null) = True Then
Log("EditText3 has focus")
End If
End Sub