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

  • Home
  • SEARCH
  • 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 7858355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:23:42+00:00 2026-06-02T21:23:42+00:00

I have a service both of started and bound type (as defined here ).

  • 0

I have a service both of started and bound type (as defined here). It is started to run indefinitely, then a separate application binds to it: when this application is destroyed, it calls the unbindService on its onDestroy method.

The service should detect that this application is finished. I read about onUnbind method, which is called when all clients have disconnected from a particular interface published by the service. However I need to know not when all clients are disconnected, but any disconnection. Is it possible?

I thought that, during the closing (inside the onDestroy method) the application could send a message to the service (taking advantage of the fact that the service is bound): later it should invoke the unbindService method, as follows.

// method of the application
@Override
public void onDestroy() {
    super.onDestroy();
    service.closed();   // service is defined by IService.aidl
    unbindService(...);
}

In this way the application would send the last message to the service (service.closed() method) and then unbind the service. Could it work correctly? Does the service.closed() method return when the message arrived at its destination? Or could there be a risk that the message is not delivered due to the next call to unbindService method?

  • 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-02T21:23:44+00:00Added an answer on June 2, 2026 at 9:23 pm

    Is it possible?

    Have the activity call a method on the Binder before unbinding to indicate that it is dropping the connection.

    Could it work correctly?

    It should. AIDL calls are synchronous, so unbindService() will not occur until after the Binder has been called with closed(), in your sample.

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

Sidebar

Related Questions

I have a console application that communicates with a web service. Both of them
I have two Services called TemplateService, TemplateReportService (both defined in one WCF Service Library)
I have a WCF service and a web application that both need to be
I have a C#/.NET program that can run both as a console application and
I have two applications: c++ service and a RoR web server (they are both
I have an ASP.NET web service running that accepts both HTTP POST and SOAP
I have classes that are needed in both my web service and my server.
I have a website that talks to a remote WCF web service. Both use
I currently have service classes that look something like this public class UserService :
We are using Dtos in our WCF service interface, but have started to come

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.