Bug? EditText_enterpressed is this a bug?

Gianni Sassanelli

Active Member
Licensed User
Longtime User
I have a strange behavior with the EditText EnterPressed event.
The problem happens with some barcode terminals that send chr(13) after barcode reads.
It is possible to simulate my problem using the ANDROID SDK emulator.

The problem is:
I have an activity containing only a view of type Edittext.
I run the app normally.
If I use pc keyboard to write values in the textbox, and press the Enter key on Pc keyboard, my app hangs with error so unaccounted for.
If I use the on screen keyboard of the device everything works fine

Can help me please?

the code in my activity is very simply for test:

B4X:
Private Txt    As EditText
Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("test_layout")
    Txt.RequestFocus   
End Sub
Sub Txt_EnterPressed
    Msgbox(Txt.Text,"ALERT")

End Sub
 

Gianni Sassanelli

Active Member
Licensed User
Longtime User
I have a strange behavior with the EditText EnterPressed event.
The problem happens with some barcode terminals that send chr(13) after barcode reads.
It is possible to simulate my problem using the ANDROID SDK emulator.

The problem is:
I have an activity containing only a view of type Edittext.
I run the app normally.
If I use pc keyboard to write values in the textbox, and press the Enter key on Pc keyboard, my app hangs with error so unaccounted for.
If I use the on screen keyboard of the device everything works fine

Can help me please?

the code in my activity is very simply for test:

B4X:
Private Txt    As EditText
Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("test_layout")
    Txt.RequestFocus  
End Sub
Sub Txt_EnterPressed
    Msgbox(Txt.Text,"ALERT")

End Sub


Hi
i think that the problem id MSGBOX used in enterpressed event when it fires from Enter received from a PC keyboard that send CHR(13)
I have maked a work around using a timer and start messagebox in Timer_tick event but this is a bug for me
 
Top