Restart the service even if app is force-stopped and Keep running service in background even after closing the app How?
I am trying to run a service in the background. What my app does is when user checks checkbox then service starts and when it is unchecked service is stopped. Which is working perfectly fine. But the problem is when I closed the app from task manager it then also stops the service. What I want is to keep the service running even after it is close from task manager. Then only way to stop that service is by user himself by unckecking the box. How can I achieve this? Here is my code My main activity public class SampleServiceActivity extends Activity { /** Called when the activity is first