Search code examples
androidservicelifecycleapplication-lifecycle

Android lifecycle with remote services and threads


I have an application with remote services and threads that will be started eventually in the services, and I was wondering: should I implement the lifecycle methods such as onPause(), onResume(), onDestroy(), etc. in the Android Activity?

Thanks in advance!


Solution

  • If you need to perform any action in these methods then you should handle else there is no need to handle. In service you need to free all the resources in onDestroy() method.