How to access other activitiy methods

gkumar

Active Member
Licensed User
Longtime User
1) Is it possible to access other activity modules methods? like public methods of C#.net?

2) Also is it possible to use/show the Panel of one activity in another activity?
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
1) CallSub will not work as the target module must be running. Only one Activity can run at a time. If you want to share code then you should create a class or code module.

You can use CallSubDelayed to call a sub in a different activity. Note however that the target Activity will become visible.
2) Technically it is possible to pass a view using CallSubDelayed. However it is not recommended as the event subs will still be in the other Activity and will not run (because the Activity is paused). Again you should use a code or class module that will create the panel for each activity.
 
Upvote 0

gkumar

Active Member
Licensed User
Longtime User
I also tried when you mentioned to use CallSub. it didn't work as I am pausing the previous activity.

But Now I am having one other problem. I created a code module, created a HttpClient object (in Process gloabls) to read the web response.

I sent the http request, but application throws an error saying _ResponseSuccess() method not found, even though this event method exists.

But the same thing works with activity module. My question is why _ResponseSuccess() event is not recognised in code module? Anything I can do to solve this problem?
 
Last edited:
Upvote 0

gkumar

Active Member
Licensed User
Longtime User
Ok. So events we need to handled always in activity module then.

I tried calling CallSubDelayed(), but this method is not recognised by editor. Any reference do we need to include?
 
Last edited:
Upvote 0

raytronixsystems

Active Member
Licensed User
Longtime User
gkumar:

Make sure you have upgraded to v2.00 of b4a to use CalSubDelayed. You can handle events in class modules in v2.00.

Regards,
Ray
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
I so much love the classes.

It's excellent we can handle events in the class.

I'm using that functionality as I re-write my taxi app.

regards, Ricky
 
Upvote 0
Top