The following code will show a "Search" button and will handle it. I'm not sure whether it is possible to show the magnifying glass without creating a small XML layout with the EditText (see XmlLayoutBuilder library).
B4X:
Sub Globals
Private EditText1 As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
Dim jo As JavaObject = EditText1
jo.RunMethod("setImeActionLabel", Array As Object("Search", 0x00000003))
Dim IME As IME
IME.Initialize("IME")
IME.AddHandleActionEvent(EditText1)
End Sub
Sub IME_HandleAction As Boolean
Log("action")
Return True
End Sub