So I have this msgBox class I made, but I need to call a function in the activity in which the class instance was initialised and called, from within the class. I thee are a few different activities which I need to notify, depending on which activity created the messagebox.
I first though to just use a bunch of these, as I am stupid:
but then I realised I was clever enough to realise that callsubDelayed will fire up those Activities instead of doing nothing with the ones that aren't active - it's only the active on I wish to notify.
So, I created this msgBox class by modifying Margret's CToast class, and in the calling parameters, there happen to be
Sub Initialize(Activity As Activity, Module As Object, Act_H As Int, Act_W As Int)
My question is, can I use any of those in some clever way to call a sub in the activity that I called the class ShowMsgBox function from?
Thanks and have a nice weekend.
I first though to just use a bunch of these, as I am stupid:
B4X:
Private Sub NotifySender
If MustNotify = True Then
CallSubDelayed2(ForcedTest, "MsgBoxResponse",ButtonResponse)
CallSubDelayed2(RelaxedTest, "MsgBoxResponse",ButtonResponse)
CallSubDelayed2(Patients, "MsgBoxResponse",ButtonResponse)
End If
End Sub
but then I realised I was clever enough to realise that callsubDelayed will fire up those Activities instead of doing nothing with the ones that aren't active - it's only the active on I wish to notify.
So, I created this msgBox class by modifying Margret's CToast class, and in the calling parameters, there happen to be
Sub Initialize(Activity As Activity, Module As Object, Act_H As Int, Act_W As Int)
My question is, can I use any of those in some clever way to call a sub in the activity that I called the class ShowMsgBox function from?
Thanks and have a nice weekend.