I\'m trying to keep service running continously until user close app.
I\'m using startService()
method from onCreate()
method of my main activi
Start by adding the android:configChanges node to your Activity's manifest node for stoping restart activity when device rotate.
android:configChanges="keyboardHidden|orientation"
Now for detecting a closing application event, think the ways user can close app manually. In android, by pressing a back button or home button. So put an event key listener for back & home button and terminate the service.