Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7814257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:08:39+00:00 2026-06-02T05:08:39+00:00

I’ve read a lot around Android service. As I understand, the lifecycle is: void

  • 0

I’ve read a lot around Android service. As I understand, the lifecycle is:

void onCreate() 
    void onStart(Intent intent) 
    ...
void onDestroy()

http://www.linuxtopia.org/online_books/android/devguide/guide/topics/fundamentals.html

But there’s is no onStop method.
Questions:

  • Why isn’t there a stop method?
  • What happens when a stopService request is made on my Service? (from outside, perhaps by Android itself). Can I detect this event?
  • I’d like to enforce (or at least verify) that my service is a singleton within a process. How can I do this (or does Android enforce this behind the scenes)?

For context, I have some resources I’d like to allocate and release while the service is running (in a “started”), and another set of resources I’d like to allocate and release while the service is a “created” state.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T05:08:41+00:00Added an answer on June 2, 2026 at 5:08 am

    As I understand, the lifecycle is:

    onStart() has been deprecated for a few years. onStartCommand() is the current lifecycle method.

    Why isn’t there a stop method?

    Because there is no need for one.

    What happens when a stopService request is made on my Service?

    You will be called with onDestroy().

    Can I detect this event?

    You can override onDestroy().

    I’d like to enforce (or at least verify) that my service is a singleton within a process. How can I do this (or does Android enforce this behind the scenes)?

    Services are natural singletons. There will be 0 or 1 instance of your service at any given time.

    For context, I have some resources I’d like to allocate and release while the service is running (in a “started”), and another set of resources I’d like to allocate and release while the service is a “created” state.

    The “created” state is used both with the command pattern (startService() and onStartCommand()) and the binding pattern (bindService() and onBind()). Hence, if you call startService(), your service will be purely in the “created” state for hopefully less than a millisecond.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.