Share My Creation WorldClock widget

rosippc64a

Active Member
Licensed User
Longtime User
My android device can't handle working widgets examples at all, so I would like to try yours one.
At compiling there is an error:
Sub GeoCoder_GeocodeDone(Address1() As Address, Tag As Object) -> Error description: Unknown type: address
Can you help me, what is missing from the zip file posted at first post?
thanks in advance
Steven
 

sifdin17

New Member

Hi.

do you remember how did you fix that issue? i am trying to run the project but i always get the same error !!!
Sub GeoCoder_GeocodeDone(Address1() As Address, Tag As Object) Error description: Unknown type: address

B4X:
Sub GeoCoder_GeocodeDone(Address1() As Address, Tag As Object)
    Dim loca As myLocation

    'Sometimes the geocoder does not return a result (timeouts?). In this case we try to geocode the search string up to 5 times.
    If Address1.Length = 0 And Tag < 5 Then
        Dim geo As Geocoder
        geo.Initialize("GeoCoder")
        geo.GetFromLocationName(gSearchString, 5, (Tag + 1))
        Return
    End If

    'Get some information from the resulting location.
    If Address1.Length > 0 Then
        For i = 0 To Address1.Length - 1
            If Address1(i).HasLatitude And Address1(i).HasLongitude Then
                Dim loca As myLocation
                loca.Initialize
                
                loca.Latitude = Address1(i).Latitude
                loca.Longitude = Address1(i).Longitude
                If Address1(i).Locality <> Null Then
                    loca.Name = Address1(i).Locality
                Else
                    If Address1(i).FeatureName <> Null Then
                        loca.Name = Address1(i).FeatureName
                    Else
                        If Address1(i).AddressLines <> Null And Address1(i).AddressLines.Size > 0 Then
                            loca.Name = Address1(i).AddressLines.Get(0)
                        End If
                    End If
                End If
                            
                If Address1(i).CountryName <> Null Then
                    loca.Name = loca.Name & " (" & Address1(i).CountryName & ")"
                End If
                Exit
            End If
        Next
    End If
    
    'If a location is found then Request timezone data from this location
    If loca.IsInitialized Then
        RequestTimeZone(loca)
    Else
        ProgressDialogHide
        ToastMessageShow("Unable to find location!", True)
    End If
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…