I have an app with an activity that records Video. The activities view has a start button and a timer graphic/textview. So when the record button is pressed it starts recording video, changes the button to a stop recording icon and starts updating the timer textview every second. When the power button is pressed and the screen turns off the activity is stopped and recording has stopped. When I turn the screen back on the activity is reset to start recording again.
The question is how do I enable the activity that is attached to the view to remain active once the screen is off/locked.
I've read about creating a service but can you attach a view to a service such that the time and stop recording UI elements are properly maintained when the screen is active again; i.e. if I start recording the timer textview starts incrementing every second, if after 5 seconds recording I lock the screen and 5 second later I activate the screen can the activity be kept alive so that the timer etc. will have kept running in the background and now display 15 seconds.
Any help much appreciated