I am using the following code to declare an EditText and display a Search icon instead of Done button
Now to capture search button
Problem is every time I type something into the textbox and hit search icon on keyboard, the log prints it twice. Which means the EnterPressed event is getting raised twice. If I remove the javaobject code that shows search icon, EnterPressed works fine as it gets raised only once. But if I display search icon, the event is raised twice.
Any idea how to fix this?
B4X:
txtname.Initialize("txtname")
txtname.Hint="Product"
txtname.SingleLine=True
Activity.AddView(txtname,10dip,lblline.Top+lblline.Height+5dip,100%x-20dip,48dip)
Dim JO As JavaObject = txtname
JO.RunMethod("setImeOptions",Array As Object(3))
Now to capture search button
B4X:
Sub txtname_EnterPressed
Log(txtname.Text)
End Sub
Problem is every time I type something into the textbox and hit search icon on keyboard, the log prints it twice. Which means the EnterPressed event is getting raised twice. If I remove the javaobject code that shows search icon, EnterPressed works fine as it gets raised only once. But if I display search icon, the event is raised twice.
Any idea how to fix this?