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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:46:58+00:00 2026-06-15T20:46:58+00:00

I have a service class that is not bound to any activity. Inside of

  • 0

I have a service class that is not bound to any activity. Inside of this service class I am putting a few unfinished audio player components. and there is a Broadcast Receiver there in the from of an anonymous inner class.

there are 5 activities in the application. How do I keep this background Service class alive while the user is navigating between the 5 activity screens. but kill the service if they navigate outside of these 5? Like if they leave and look at a different pornography application?

one idea I read about is to bind the service in the onResume() of each Activity and un-bind it in the onPause() of each of the 5 activities.

What is the best way to do this?

  • 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-15T20:46:59+00:00Added an answer on June 15, 2026 at 8:46 pm

    Each application can also have an Application class.

    You might want to bind from there and keep track of which activity is open.

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

Sidebar

Related Questions

i have a class that uses a proxy class inside to call a service
I currently have service classes that look something like this public class UserService :
I have this code that describes a service: public class navigation_web extends Service {
I have a Service class that stores an object into the session $this->session->set('utmUser', $this->session->serialize($this->utmUser));
I have a service class that I need to execute a method on a
I have a wcf service. The service itself (class that inherits the ServiceContract )
I have created a service class for my network connection so that my app
I have a REST service and I want to have a helper class that
I have some class that I'm passing as a result of a service method,
I have a POCO class that is mostly built through a service. I hit

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.