Hello, I have a problem with a ToggleButton which starts the GPS or pause, well the thing is that it works, but I do not NumberFormatException error I have to go to the Options menu and back out to the main screen.
In Designer I changed the INPUT TYPE: TEXT > NUMBERS, and what I have set EditText INPUT_TYPE_NUMBERS and multiply by 1000 so that when multiplied by the contents of EditText me in x seconds.
I wanted to ask this would be the right way, or am I wrong and to multiply the contents of an EditText by a number, it is otherwise?
Is that when I changed the type, the GPS does not stop the time stated in the EditText.
Previous contents of the ToggleButton:
Content updated ToggleButton:
In Designer I changed the INPUT TYPE: TEXT > NUMBERS, and what I have set EditText INPUT_TYPE_NUMBERS and multiply by 1000 so that when multiplied by the contents of EditText me in x seconds.
I wanted to ask this would be the right way, or am I wrong and to multiply the contents of an EditText by a number, it is otherwise?
Is that when I changed the type, the GPS does not stop the time stated in the EditText.
Previous contents of the ToggleButton:
B4X:
Sub ToggleButton_GPS_CheckedChange(Checked As Boolean)
Dim gpsTime As String
gpsTime = EditText_timeGPS.Text * 1000
If Checked = True Then
ToastMessageShow("Dispositivo GPS: Iniciado", True)
GPS1.Start(gpsTime, 0)
Else
ToastMessageShow("Dispositivo GPS: Pausado", True)
GPS1.Stop
End If
End Sub
B4X:
Sub ToggleButton_GPS_CheckedChange(Checked As Boolean)
Dim gpsTime As String
gpsTime = EditText_timeGPS.INPUT_TYPE_NUMBERS * 1000
If Checked = True Then
ToastMessageShow("Dispositivo GPS: Iniciado", True)
GPS1.Start(gpsTime, 0)
Else
ToastMessageShow("Dispositivo GPS: Pausado", True)
GPS1.Stop
End If
End Sub