开发者

How do i get service timer for my video recording application?

开发者 https://www.devze.com 2023-03-07 18:53 出处:网络
Hi guys i wanted a \"service\" timer which enable my camera to show the elapsed(incremental) time of a timer when the video recording process has started in such a format 00:00:00? But i do not know h

Hi guys i wanted a "service" timer which enable my camera to show the elapsed(incremental) time of a timer when the video recording process has started in such a format 00:00:00? But i do not know how to code the above function in a service activity since it poses the problem of not allowing xml content to link with my mainActivity which in my case is a video recording activity to update the elapsed time on a textview, correct me if i'm wrong or is there a work around/solution?

And when the camera exits and returns the service should still keep track of the time since started and update the textview accordingly... Can 开发者_JS百科someone help me on this matter i'm rather new to android/java programming?

This is what i have tried out so far for my mainActivity which performs the recording and display the updated elapsed time of the timer..


There may be a better answer, but you could just obtain the time when the recording starts and remember it. It's not clear what owns the textview, but whatever does could update it from the current time by subtracting the start time. You can also pass the service a callback handler which it could use to send you update messages.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号