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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:37:00+00:00 2026-06-10T05:37:00+00:00

I want to run a task that would accept a single string and download

  • 0

I want to run a task that would accept a single string and download that file from the server.
Since network related operations have to be performed on the different thread I have to extend AsyncTask. Referring the online doc I see that it takes three parameters i.e Params, Progress and Result.

I understand that it makes sense to extend a class like this

private class DownloadFileTask extends AsyncTask<URL, Integer, Long>

But right now I just want to download the file and not show any progress or return anything from the function.

extending a class like this gives me error

    private class DownloadFileTask extends AsyncTask<String, void, void>
     {
       protected void doInBackground(Sting url)
       {    //code to simply download file , no progress shown , nothing returned
       }
     }

I also understand as an implementing class DownloadFileTask show override the method

protected abstract Result doInBackground (Params... params)

the Result in its prototype is the third parameter of AsyncTask<…> Template. So I cant have that as void. But isnt there a way to simply download file without showing progress and result?

  • 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-10T05:37:01+00:00Added an answer on June 10, 2026 at 5:37 am

    The generic arguments should be objects, so you should pass Void instead of void.

    ....extends AsyncTask<String, Void, Void>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to run a background task that reads input from a TextReader and
We have tests using WatiN that we want to run on our CruiseControl.NET server.
I would like to run a task if any file in an item list
I want run all script from the directory . Like , The directory contains
I have written php program and uploaded on server. I want run this program
Want to run javascript function from parent window in child window Example I have
I have a series of 'tasks' that I would like to run in separate
I have a little .exe written in c# .net that I want to run
Requirement - I have a periodic task I want to run in a Windows
When I run a single-threaded program that i have written on my quad core

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.