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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:44:39+00:00 2026-05-13T12:44:39+00:00

I have multiple activities and one service. In MainActivity I successfully connect to service

  • 0

I have multiple activities and one service. In MainActivity I successfully connect to service (using a class that implements ServiceConnection + bindService() + startService()) but when I try to apply same method in other activity I see in LogCat a error:

01-15 22:29:37.438: ERROR/ActivityThread(12206): android.app.ServiceConnectionLeaked:  
    Activity com.app.liviu.simpleMusicPlayer.PlaylistActivity has leaked ServiceConnection  
    com.app.liviu.simpleMusicPlayer.PlaylistActivity$CounterServiceConnection@43713c90  
    that was originally bound here.

Is it possible to connect to a service in an other way: something like to make static my CounterServiceConnection object in MainActivity and use it in the second one?

  • 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-05-13T12:44:39+00:00Added an answer on May 13, 2026 at 12:44 pm

    The error message is fairly self-explanatory: you are leaking a ServiceConnection, by which Android means you are calling bindService() but are not calling unbindService(), and the activity that called bindService() was destroyed. Make sure you call unbindService() in onDestroy(), if not sooner.

    something like to make static my
    CounterServiceConnection object in
    MainActivity and use it in the seconde
    one?

    No.

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

Sidebar

Related Questions

I have some data that multiple Activities need to manipulate. Basically there is one
I currently have an app that requires connection to a server in multiple activities.
In one of my Activities, I have multiple ListView controls. Say List 1 ,
I have created a compound control that I am reusing in multiple activities. This
I have an application with multiple activities. On one of them, I set up
I simply have 2 tabs and used Experience - Multiple Android Activities in a
I simply have 2 tabs and used Experience - Multiple Android Activities in a
I have multiple applications that share a config file that sets up NLog partially
I have multiple URLs that returns zip files. Most of the files, I'm able
My one web page uses Ajax to display information about multiple activities. I'd like

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.