Ask for confirmation from android service

I have a service that has a certain listener. Once that event occurs - the service wants to do some processing (say doStuff()), but before the service starts to do this processing, I want to ask user if he wants to cancel it (Through activity with dialogue theme) . So if user wants to cancel, he can do it in 30 seconds - if not cancelled; the service will start with the processing.

What is the best approach to accomplish this? I can show Activity with cancel button from service - but not sure how can I process user inputs or finish activity after specified time. Any pointers would be highly appreciated!