I've never used modules before and am trying to tidy up my Main by breaking off into smaller modules. Hope that makes sense.
What I'm trying to do now is just populate a spinner from a different module. I've tried numerous variations and have attached my latest attempt. Not sure if I'm even using the proper type of module? I was trying to use Erel's static code module tutorial as an example, but don't know what to put in the Main.
Thanks
Code module cannot have views and spinner is a view.
Since you put the spinner in the main layout, you have it in the main activity.
The module cannot access it because it is a view, but you can get the data from there and fill it in the main.
in main:
B4X:
Sub myStart
spnTest.AddAll(fillSpinners.fill_spnTest)
End Sub
in module:
B4X:
Public Sub fill_spnTest as string()
Dim str() as string = Array As String("a","b","c","d"))
Return str
End Sub
Thanks for the replies, will definitely check these out tomorrow.
I was just looking for an example of how to do this from another module as I've never used modules before and have a few spinners that I will need to fill, eventually from database. I just thought it might be less confusing for me if I could break it off into a module so that once I get that correct I could concentrate on other aspects.
Thanks