I call an activity from my main activity and pass the ME object, call the callsub2 from the open activity and it does not activate the sub on the main activity.
Main Activity call second activity:
B4X:
Sub Keys_Click
actCompanySelect.bShowOnlyMK = False
actCompanySelect.oClassCalled = Me
actCompanySelect.strCompFileLoc = strMKDirLoc
actCompanySelect.strCompFileLocMembers = strMMDirLoc
StartActivity(actCompanySelect)
End Sub
Calling sub from second activity:
B4X:
Sub btCSOK_Click
' If iRowSelect <> -1 Then
Dim R(3) As Object
R(0) = tblCS.GetValue(1,iRowSelect)
R(1) = tblCS.GetValue(2,iRowSelect)
R(2) = tblCS.GetValue(3, iRowSelect)
CallSub2(oClassCalled,"AsignCompanySelect",R)
CallSub(oClassCalled, "AsignCompanySelect")
' End If
Activity.Finish
End Sub
sub on main activity:
B4X:
Sub AsignCompanySelect(data() As Object)
'kinda like a raised event.
strCompKeyName = data(0)
strCompName = data(1)
strCompID = data(2)
Dim sKey As String
If strCompID.SubString2(0,2) = "MK" Then
sKey = "MK"
Else
sKey = "MMK"
End If
lbKeyUsed.Visible = True
lbKeyUsed.Text = strCompKeyName & " - " & sKey
lbKeyUsed.TextColor = Colors.Black
End Sub
I've tried not closing the activity and still nothing..