Android Question Pass more than one parameter values to other activites

fasilosman

Active Member
Licensed User
Longtime User
Can anyone help me to pass more than one parameter values from one activity to another activity.

I used - CallSubDelayed2("activityname","SubName",value)

it can pass one value, according to my knowledge.

Please help me with a simple solution
 

DonManfred

Expert
Licensed User
Longtime User
Use a map which you pass to the other activity.... The map can contain more than one value....
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
I believe CallSubDelayed3 allows more that 1 value. Failing that you could always try passing an array or list (no idea if it will work mind...)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
B4X:
Dim m As Map
m.Initialize
m.Put("Keyname","Value")
m.Put("Keyname2","Value2")
m.Put("Keyname3","Value3")
CallSubDelayed2("activityname","MySubName",m)

and the sub should have this signature
B4X:
Sub MySubName(m As Map)
    For i = 0 To m.Size-1
        Log(m.GetKeyAt(i)&"="&m.GetValueAt(i))
    Next
End Sub
 
Last edited:
Upvote 0

fasilosman

Active Member
Licensed User
Longtime User
B4X:
Dim m As Map
m.Initialize
m.Put("Keyname","Value")
m.Put("Keyname2","Value2")
m.Put("Keyname3","Value3")
CallSubDelayed2("activityname","MySubName",m)

and the sub should have this signature
B4X:
Sub MySubName(m As Map)
    For i = 0 To m.Size-1
        Log(m.GetKeyAt(0)&"="&m.GetValueAt(0))
    Next
End Sub
Thank a lot
 
Upvote 0
Top