Android Question Clear EditText from Scanning

junaidahmed

Well-Known Member
Licensed User
Longtime User
I have an EditText with some Value,I would like to know to clear EditText When Scanning from external Barcode device...
 

MarkusR

Well-Known Member
Licensed User
Longtime User
if u have a Barcode reader as keyboard simulation (ex via Bluetooth connected), normal it send a line break char (return)
so u need process this text after the device simulate the enter key
and then set the text property to empty string.
 
Upvote 0

Bladimir Silva Toro

Active Member
Licensed User
Longtime User
Hello
what I use to know if there is any value in the EditText is:
B4X:
Sub TxtBarCode_FocusChanged (HasFocus As Boolean)
    If TxtBarCode.Text.Length>=1 Then
        SearchPCod(TxtBarCode.Text)
    End If
End Sub
To clean the EditText in the SearchPCod function if it does not find the product is:

B4X:
ToastMessageShow("Product "&TxtBarCode.Text&" Does not exist",True)
TxtBarCode.Text =""
TxtBarCode.RequestFocus
I use a barcode reader connected by Bluetooth
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…