Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
Panel1.Visible = False
If gmap.IsInitialized = False Then
Wait For MapFragment1_Ready
gmap = MapFragment1.GetMap
End If
ProgressDialogShow2("Waiting for location...", True)
WaitForFirstLocation
End Sub
Sub WaitForFirstLocation
Do While gmap.MyLocation.IsInitialized = False
Sleep(500)
Loop
Dim cp As CameraPosition
cp.Initialize(gmap.MyLocation.Latitude, gmap.MyLocation.Longitude, 10)
gmap.MoveCamera(cp)
Panel1.Visible = True
ProgressDialogHide
End Sub
Sub Activity_Resume
If gmap.IsInitialized And Panel1.Visible = False Then WaitForFirstLocation
End Sub