Android Question [SOLVED] Timer_Tick from another activity/service

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hi,
Could you please confirm me that this way of doing things is correct ? I am not sure to do the right things.

I am using an activity and a service. In the Process_Globals of the activity, I define a Timer that I can reuse from the service.

I can use the Timer from the activity or from the service. I manage the Timer_Tick inside the activity. So, when initializing the Timer from the service, I create a sub named Timer_Tick and pointing to the same Timer_Tick inside the activity, using callsubdelayed.

Or could I use different Timer_Tick subs : one in the activity and the other in the service ?
Thanks
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
The tick is called in that activity where you initialized the timer.
It could be the activity or a service.
 
Upvote 0

JohnD

Active Member
Licensed User
Longtime User
Can either of you extremely talented programmers (or some other genius) post an example of how to implement a background Timer with a service? Specifically, I want to my interval to be in milliseconds. In what I have tried so far, the Service does not give control back to the calling activity. Maybe the interval is to small for? :) Thanks, JD.
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
What doy you want to do in the timer-tick???
When do you need the control back in the activity (and WHY)?

I mean; if you do not need to change the ui then you dont need to give the control back to the activity....

You should describe more in details what you want to archieve...

PS: Better would be to create a new thread cause @lemonisdead already have set the thread to "solved"
 
Last edited:
Upvote 0
Top