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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:37:33+00:00 2026-06-08T22:37:33+00:00

I m running a queue where i m downloading videos and for que to

  • 0

I m running a queue where i m downloading videos and for que to work properly in need to get the postExecute of AsyncTask called mandatorily..or there must b an event where i can get when my asynctask is getting killed by the processor which says “No more Background Tasks”..Low memory..OnCancelled not getting called too…Any help???


@kdehairy Intent Service??? Okk actually i need to update my UI..For example i have a video being downloaded which started in asynctask and i keep track of the chunk and accordingly update my custom progressBar if the user destroys the activity m not cancelling my ansynctask till my work is done..i keep track of asynctask..if for some reason my asynctask stops even if its in background…it agains ques the task..which is done by service…what i m saying is even i dont know my asynctask is queued from service or app…but i just kip track of asyncatsks being queued..and push and pop from stack..asynctask postexecute refreshes my view…like in if asynctask is running from service i check in postExecute if my UI screen is visible…and than i call new Intent..with Flags SingleTop and New Task and thus i can refresh my progressBar..Can i update my UI using IntentService..will it run on UIThread or worker thread..

Can u provide me an example…???
Thanks Kdehairy

  • 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-08T22:37:34+00:00Added an answer on June 8, 2026 at 10:37 pm

    If it is critical for you to handle the life cycle of your process, then it is better to use a service.
    AsyncTask is not a system component (Services are).

    UPDATE:

    1. extend the IntentService with your own implementation.
    2. to update the UI you can use boradcasts. as follow:

      1. whenever you need to update your UI, wirte this in your service:
        
        Intent intent = new Intent(ACTION_UPDATE_PROGRESS);
        intent.putExtra(EXTRA_POSITION, currentValue);
        LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
        

        Here we are sending a broadcast using the LocalBroadcastManager because we want to keep this broadcast private to the application.

      2. in your Activity:

        
        // this is the broadcast receiver object that will handle our UI updates.
        private BroadcastReceiver mReceiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                int position = intent.getIntExtra(YourService.EXTRA_POSITION, 0);
                // do your UI updates here.
            }
        }
        
        @Override
        protected void onResume() {
            // register for the broadcast.
            LocalBroadcastManager.getInstance(this).registerReceiver(
                mReceiver,
                new IntentFilter(YourService.ACTION_UPDATE_PROGRESS));
            super.onResume();
        }
        @Override
        protected void onPause() {
            // unregister when activity is paused.
            LocalBroadcastManager.getInstance(PlayerActivity.this)
                .unregisterReceiver(mPlayerReceiver);
            super.onPause();
        }
        

    If you find anything unclear, please let me know.

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

Sidebar

Related Questions

I was testing out RQ (Redis-Queue) when after running the command rqworker and testing
I'm tinkering away on a multithreaded downloader, using a producer/consumer queue construct; the downloading
I want a long-running process to return its progress over a Queue (or something
I am running a simple Java client to connect to a remote MQ queue.
I'm using the DownloadManager to queue up some downloads I'm making but running into
I want to put a message out of PL/SQL directly into a running Queue,
I have an app running which looks at items in a queue, then based
I have a simple messaging queue setup and running using the Zend_Queue object heirarchy.
The sender and receiver channels between two queue managers (WebSphere MQ v7.1 running on
I understand a running asio service is like a queue I can use to

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.