activity

abstract fun activity(): ComponentActivity?

Asks the delegate to provide an activity instance. If you have a custom logic that handles activity lifecycle, you may return null to cleanup the service and stop the flow safely when activity has been destroyed.