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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:21:35+00:00 2026-06-04T04:21:35+00:00

is it in general better to create AsyncTask as private class within an Activitiy,

  • 0

is it in general better to create AsyncTask as private class within an Activitiy, or rather separate them in an own class?

public class MyActivity extends Activity {
  private class DownloadPage extends AsyncTask {
  }
}
  • 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-04T04:21:36+00:00Added an answer on June 4, 2026 at 4:21 am

    AsyncTask inside Activity is more suitable after completing backgroud task you can change view easily.

    In seperate class you need to pass context and its result comes in seperate class and then you have to get result from seperate class.

    But seperate class is very useful sometimes when we need more asyncTask in application ,
    and if you have large code in your activity so its better to use seperate class.

    So AsyncTask is suitable inside Activity to interact with view…and seperate class is also
    suitable when we need more asynctask in application.

    So its totally depends on requirements…

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

Sidebar

Related Questions

I have a general Database Design question: When is it better to create a
In general, is it better to have a web application make lots of calls
I just wanted to get the general consensus on which is a better mode
general question is i like to build logger class that writes to single log
In general reflection in a base class can be put to some good and
Which is a better design approach: Having separate link/association tables for each type of
Is it possible to create WMP11+ (well, sure, the more versions the better, but
I am trying to create a code coverage tool using Delphi 2007. My general
First i am a beginner in programming in general, i am trying to create
Hello This is a general question.I want to create a simple report just some

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.