Google News
logo
Android - Quiz(MCQ)
How can we stop the services in android?
A)
By using the finish() method
B)
By using the stopSelf() and stopService() method
C)
By using system.exit() method
D)
None of the above

Correct Answer :   By using the stopSelf() and stopService() method


Explanation : A service is started when a component (like activity) calls the startService() method; now, it runs in the background indefinitely. It is stopped by the stopService() method. The service can stop itself by calling the stopSelf() method.

Advertisement