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 7793655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:33:23+00:00 2026-06-01T22:33:23+00:00

I’m writing a SIP application using an SDK. My application has many Activities and

  • 0

I’m writing a SIP application using an SDK. My application has many Activities and so I initialise and shutdown the SDK using a service’s onCreate and onDestroy methods so that I can run it for the duration of my Application (not just an individual Activity).

The example application I’m working from calls startService and then just leaks the service – I don’t want to do this but I’m not sure that I have an alternative.

What I would like to do is bind to the service using Context.BIND_AUTO_CREATE in my Activity base class’s OnCreate method and unbind in OnDestroy. All of my Activities extend from this, so I would then have the Service available in all of my Activities.

But, what happens when the configuration changes or I switch activities? Does the service get aggressively killed in the brief period between activities, or is there a guarantee that it won’t? If it’s the former, doesn’t that slightly cripple the use of services? What design pattern should I be using to make something persist for exactly the lifetime of my Application?

  • 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-01T22:33:24+00:00Added an answer on June 1, 2026 at 10:33 pm

    I’ve realised I’m asking the wrong question. I’m assuming the Application will be destroyed when the user finishes with it, which it probably won’t, it’ll just sit in the background, and so will my service. I think I need a redesign.

    Furthermore if I really wanted to continue down that path (which I now don’t), I could bind the service to my application, it would then exist for the lifetime of the application (which, as I remembered, will be indefinite unless the user kills it or Android reclaims it). In this instance I don’t need to specifically call unbind, as the binding will be destroyed along with the application.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
In my XML file chapters tag has more chapter tag.i need to display chapters

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.