G gkumar Active Member Licensed User Longtime User Jun 22, 2012 #1 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: Jun 22, 2012
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?
thedesolatesoul Expert Licensed User Longtime User Jun 22, 2012 #2 Use CallSub. Sent from my GT-I9000 using Tapatalk 2 Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jun 22, 2012 #3 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
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.
thedesolatesoul Expert Licensed User Longtime User Jun 22, 2012 #4 Ah yes, sorry. CallSub only works when the other entity is active. Normally I would set a flag in process globals and check it in Activity_Resume. Or do as Erel says (it always pays off!) Upvote 0
Ah yes, sorry. CallSub only works when the other entity is active. Normally I would set a flag in process globals and check it in Activity_Resume. Or do as Erel says (it always pays off!)
G gkumar Active Member Licensed User Longtime User Jun 24, 2012 #5 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: Jun 24, 2012 Upvote 0
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?
Erel B4X founder Staff member Licensed User Longtime User Jun 24, 2012 #6 You should use CallSubDelayed instead of CallSub. Code modules cannot handle events. See the code modules tutorial. Upvote 0
You should use CallSubDelayed instead of CallSub. Code modules cannot handle events. See the code modules tutorial.
G gkumar Active Member Licensed User Longtime User Jun 24, 2012 #7 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: Jun 24, 2012 Upvote 0
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?
R raytronixsystems Active Member Licensed User Longtime User Jun 25, 2012 #8 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
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
Ricky D Well-Known Member Licensed User Longtime User Jun 25, 2012 #9 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
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