Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Scroll As ScrollView
Dim CmbRegione As Spinner
Dim Cmbprovince As Spinner
Dim cd As ColorDrawable
Dim PanelHeight As Int : PanelHeight=80dip
Dim REGIONE ="Regione", PROVINCIA ="Province", PNL ="Panel", COUNT="Conteggio" As String
Dim prov(20) As String
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout ("frmricercaview")
Scroll.Initialize (100%x)
Activity.AddView (Scroll, 0, 40dip, 100%x, 100%y)
Scroll.Color =Colors.Black
CmbRegione.Left =Activity.Width /2 - CmbRegione.Width /2
CmbRegione.Prompt ="Regione"
FetchCountriesRegione
CmbRegione.SelectedIndex =0
FetchProvince
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub FetchCountriesRegione
'Utilizzato per riempire ilcombox delle regioni
ProgressDialogShow("Sto caricando le informazioni")
'Gets all the available countries
ExecuteRemoteQuery("SELECT Regione FROM regioni ORDER BY Regione", REGIONE)
End Sub
Sub FetchProvince
'Utilizzato per riempire la variabile delle province secondo la regione selezionata
ProgressDialogShow("Sto caricando le informazioni")
'Gets all the available countries
ExecuteRemoteQuery("SELECT Provincia FROM province WHERE Regione ='" & CmbRegione.SelectedItem &"' ORDER BY Provincia", PROVINCIA)
'Here goes wrong because cmbregione not initialized
End Sub