Post a small example project showing the problem.
A customType should be placed in process_globals and can be accessed from any activity in the prject.
The best place i guess is in the Start service.
Type
Declares a structure.
Can only be used inside sub Globals or sub Process_Globals.
Syntax:
Type type-name (field1, field2, ...)
Fields include name and type.
Example:
Type MyType (Name As String, Items(10) As Int)
Dim a, b As MyType
a.Initialize
a.Items(2) = 123
Be inspired by this code...
Main
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private edtName As EditText
Private edtStreet As EditText
Private edtTown As EditText
Private Button1 As Button
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")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
Starter.ActAddress.Name = edtName.Text
Starter.ActAddress.Street = edtStreet.Text
Starter.ActAddress.Town = edtTown.Text
StartActivity(Act2)
End Sub
Starter
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Type address (Name As String, Street As String, Town As String)
Dim ActAddress As address
End Sub
Sub Service_Create
'This is the program entry point.
'This is a good place to load resources that are not specific to a single activity.
End Sub
Sub Service_Start (StartingIntent As Intent)
ActAddress.Initialize
End Sub
Act2
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private lblName As Label
Private lblStreet As Label
Private lblTown As Label
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("Layout2")
lblName.Text = Starter.ActAddress.Name
lblStreet.Text = Starter.ActAddress.Street
lblTown.Text = Starter.ActAddress.Town
End Sub
Project attached