Hello,
May be it is a silly question.
But I am not able to call a sub within the same activity.
I have written the below sub with the activity named (actmap)....
Now I am calling the above sub [gps_check] within the same activity
The below error I am getting
Can anyone advice as what I am doing wrong?
May be it is a silly question.
But I am not able to call a sub within the same activity.
I have written the below sub with the activity named (actmap)....
B4X:
Sub gps_check
rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Starter.flp.IsConnected = False Then
SetState("Location provider not available")
End If
If Result Then
Dim rs As ResumableSub = CallSub(Starter, "CheckLocationSettingStatus")
Wait For (rs) Complete (SettingsResult As LocationSettingsResult)
Dim sc As StatusCodes
Select SettingsResult.GetLocationSettingsStatus.GetStatusCode
Case sc.SUCCESS
SettingsAreGood
Case sc.RESOLUTION_REQUIRED
SetState("RESOLUTION_REQUIRED")
SettingsResult.GetLocationSettingsStatus.StartResolutionDialog("srd")
Wait For srd_ResolutionDialogDismissed(LocationSettingsUpdated As Boolean)
If LocationSettingsUpdated Then
SettingsAreGood
Else
SetState("Not enabled")
End If
Case Else
SetState("Not available")
End Select
Else
SetState("No permission")
End If
End Sub
Now I am calling the above sub [gps_check] within the same activity
B4X:
Sub MapFragment1_Click (Point As LatLng)
CallSub(actmap,"gps_check")
End Sub
The below error I am getting
B4X:
actmap - 92: Undeclared variable 'actmap' is used before it was assigned any value.
Can anyone advice as what I am doing wrong?