In case of low memory if android closes a service forcefully, then will it restart automatically or user has to start that service?
It will never be restarted again by Android.
User has to restart it again.
Option 1 is true only if programmer has not returned START_NOT_STICKY from onStartCommand()
Option 1 is true if programmer has returned START_STICKY or START_NOT_STICKY
If android has stopped service with out user's knowledge, then it is the responsibility of android to restart it. But this rule will not be applicable if programmer returns START_NOT_STICKY from onStartCommand().
Back To Top