I have a regular edittext box with numbers only. When I press done with the box being empty I get the number format exception, Invalid double. I need to know how to set it so that if this happens and an empty string is sent that I can either insert an alert or put in a set value and not have the edittext box close. Any help would be greatly appreciated. Thanks.
B4X:
Sub EditText1_EnterPressed
If EditText1.Text > 1000 Then EditText1.Text = 1000
If EditText1.Text < 1 Then EditText1.Text = 0
Packet = "f" & EditText1.Text
astreams.Write(Packet.GetBytes("UTF8"))
ToggleButton1.Checked = False