I'm trying to keep service running continously until user close app.
I'm using startService()
method from onCreate()
method of my main activity and stopService()
in onDestroy()
method.
Now I have problem, because it seems that my main activity dies and is re-created when I rotate device or when I turn off screen.
How can I stop my service only when user stops app manually?