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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:28:43+00:00 2026-05-26T03:28:43+00:00

I have a service which has a method that downloads an image from an

  • 0

I have a service which has a method that downloads an image from an URL and returns an Uri.
That service will get more complex when it has all the intended features. Therefore,
I’m invoking its methods within a thread.

My problem is how to warn the activity that the service has done it’s work.

I could change a class isFinished variable but the activity had to be constantly checking
for its value.

I just want the service to tell the activity that it’s work is done and the resources are
available for use.

I thought something in the lines of the service calling stopSelf() and the activity was
warned through “onServiceDisconnected” but that didn’t seem very “political correct”.

Thanks in advance

  • 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-26T03:28:43+00:00Added an answer on May 26, 2026 at 3:28 am
    public class MyActivity extends Activity{
    
        public MyActivity() {
            ...
            MyThread thread = new MyThread(this);
            thread.start();
        }
    
        public void onFinishedThread(...) {
    
        }
    }
    
    class MyThread extends Thread {
    
        MyActivity activity;
    
        public MyThread(MyActivity activity) {
            this.activity = activity;
        }
    
        public void run() {
            // do work
            ...
            this.activity.onFinishedThread(...);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple WCF service which has a method that returns a complex
I have a WCF service which exposes a method that returns an array of
I have the web service, which has method State() that returning the List. where
Let's say I have a WCF service which has a method returning object Person.
I've an application that has a widget already and have a service which updates
I have a WCF service which has one method returning a stream. [ServiceContract] public
I have a domain service, derived from LinqToEntitiesDomainService<FOOEntities> It has one method, IQueryable<Bar> GetBar().
I have a service which has one endpoint , I have defined this endpoint
I have a service class which has overloaded constructors. One constructor has 5 parameters
I have a service named WcfService2 (original i know) which has an IService.cs file

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.