Sub GPS_LocationChanged (Location1 As Location)
label2.Text = Location1.ConvertToMinutes(Location1.Latitude)
label3.Text = Location1.ConvertToMinutes(Location1.Longitude)
End Sub
Sub togglebutt_CheckedChange(Checked As Boolean)
If togglebutt.Checked = True Then
Dim location2 As Location
End If
If signal= True Then 'Detects if valid GPS signal is present
Dim LatValue = label2.text
Dim LongValue = label3.text
If GPS1.GPSEnabled = False Then
togglebutt.Checked = False
ToastMessageShow("Please enable the GPS.", True)
StartActivity(GPS1.LocationSettingsIntent) 'Will open the relevant settings screen.
Else
GPS1.Start(0, 0) 'Listen to GPS with no filters.
togglebutt.Checked = True
ToastMessageShow("Location saved.", True)
'Starts Alert????????? (receive error about not being a double here)
addProximityAlert(60,LatValue,LongValue,-1)
End If
Else
ToastMessageShow("Please wait for a GPS signal.", True)
togglebutt.Checked=False
End If