calling from Activity

rossati

Active Member
Licensed User
Longtime User
Hello

I am not able to communicate from activity i.e. I have a Main activity which active another Activity (which generate a multiwidget form) and I would manage some events by main Activity, so in Main I have something like this (is only the last of my tries):

Sub handleChange3(wdg As Object,parms() As Object) As String
If parms(0) = "Dollar" Then
Dim txt As EditText
txt = wdg
Msgbox("Dollar: " & txt.Text,"")
End If
End Sub

Msgbox crashes on Null pointer exception.

In the calling activity I have:

Sub txt_FocusChanged (HasFocus As Boolean)
If Not(HasFocus) Then
fh_sender = Sender
Log("*************** " & fh_sender)
CallSub3(fh_externalCaller,"handleChange3",Sender,Array As Object ("Dollar","","LF"))
End If
End Sub


Besides I have discovered that if the activity is not active, from its Functions we do not have access to global variables of the Activity active, is this correct?

Thanks

John Rossati
 

rossati

Active Member
Licensed User
Longtime User
Thanks Erel

your suggestion works but resume Main Activity.
I try a cleaner solution putting my handler in a code module.

Question can I call via callSub a sub in a codeModule?

John Rossati
 
Upvote 0

rossati

Active Member
Licensed User
Longtime User
Thanks

it is also not really needed as you can call the sub directly

yes and not, I would like to parameterize certain actions, so as to allow customization of my form generator.

John Rossati
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…