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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:12:19+00:00 2026-05-25T10:12:19+00:00

I’ve encountered a weird issue that has gotten me stumped for a few days

  • 0

I’ve encountered a weird issue that has gotten me stumped for a few days now. First some background info:

I have an activity that binds to a third party service (given to me as a library). This service sends asynchronous callbacks to the client (my activity) whenever the client requests an action be performed. The service is never started with startService() and stopService() calls; I perform bind when i need the servcie and unbind when I am done. I never have more than one activity bound to the service at any one time.

My issue:

The user starts my activity (lets call it instance A). I bind to the service in onCreate() and issue a request. I receive a callback from the service and set some local variables accordingly. Once i go through what i need to do, i call finish(). onDestroy() gets called and i then perform un bind service. My assumption at this point is that both the Service instance and my activity should not be able to be referenced any more.

Now, after A has finished, the user starts my activty again (lets call this instance B). I again bind in onCreate and issue a request. However when i receive a callback, i notice that the service has issued a callback to my old “ghost” instance A. I am now using all of instance A’s local variables instead of using This new instance B. I even printed out the “this” reference before binding and again after receiving the callback and was able to see that the reference changes from instance B’s to instance A’s. Execution in my activity continues to proceed, but since my local variables are now set incorrectly to their old state at the end of A’s execution, B’s execution fails.

So a few questions:

  1. How is it possible that A is still being referenced after
    onDestroy() and unbind is called?
  2. Is it likely that this issue could be related to the third party
    service and not my implementation? (again, I don’t have the
    source code to this service, i’m just using it)

Thanks for any insights you all can offer.

-Jason

  • 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-25T10:12:19+00:00Added an answer on May 25, 2026 at 10:12 am

    Turns out it was the the third party service.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,

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.