I have made an activity in android. From that activity on the button click, I am calling an intent in which i have called an AIR app.Along with that I am starting the Service which contains socket communication with the AIR app.But when I go back from AIR to activity, the service is not getting stopped. Its running in background. I have used onDestroy, startService, stopService but not working. Can anyone suggest me on back navigation from AIR to app how can I stop the service.So that if i want to switch again from activity to AIR i can refresh it again.
Share
The service cannot be stopped could be due to several reasons. You might have done some thing like registering a broadcast receiver using service context or some objects that attaches its life cycle to the service.
The solution is that you free or release the objects before stopping the service.