M Mickster Active Member Licensed User Longtime User Feb 10, 2013 #1 I was wondering if there's a way to return the currently running activity? I know you can use 'isPaused()' but I have a lot of activities and would rather avoid keeping this if statement up to date when I create new activities. For context, I'm creating a notification system for my app. It will be a class and will create alert boxes of my own design on the activity. The problem is that I have a service module to deal with communications and this module needs to be able to create notifications on the running activity.
I was wondering if there's a way to return the currently running activity? I know you can use 'isPaused()' but I have a lot of activities and would rather avoid keeping this if statement up to date when I create new activities. For context, I'm creating a notification system for my app. It will be a class and will create alert boxes of my own design on the activity. The problem is that I have a service module to deal with communications and this module needs to be able to create notifications on the running activity.
Erel B4X founder Staff member Licensed User Longtime User Feb 11, 2013 #2 You will need to implement it. You can create a CurrentActivity (Object) variable in your service and then add the following code to each Activity: Code: Copy Sub Activity_Resume YourService.CurrentActivity = Me ... Upvote 0
You will need to implement it. You can create a CurrentActivity (Object) variable in your service and then add the following code to each Activity: Code: Copy Sub Activity_Resume YourService.CurrentActivity = Me ...
mc73 Well-Known Member Licensed User Longtime User Feb 11, 2013 #3 Erel said: You will need to implement it. You can create a CurrentActivity (Object) variable in your service and then add the following code to each Activity: Code: Copy Sub Activity_Resume YourService.CurrentActivity = Me ... Click to expand... Just as an addition, the check for isPaused should still be performed (just for CurrentActivity object) or use a callSubDelayed. At least so I think. Upvote 0
Erel said: You will need to implement it. You can create a CurrentActivity (Object) variable in your service and then add the following code to each Activity: Code: Copy Sub Activity_Resume YourService.CurrentActivity = Me ... Click to expand... Just as an addition, the check for isPaused should still be performed (just for CurrentActivity object) or use a callSubDelayed. At least so I think.