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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:26:34+00:00 2026-06-07T21:26:34+00:00

Something that puzzles me since months. Is the following construct save? AsyncTask is an

  • 0

Something that puzzles me since months. Is the following construct save? AsyncTask is an inner class in an Activity. AsyncTask calls a method within the Activity class. This method does not use activity objects or UI calls.

public class MyActivity extends Activity {

    private class MyAsyncTask extends AsyncTask<Void, Void, Void> {

        @Override
        protected void doInBackground(...) {
            longRunningMethod();
        }

        @Override
        protected void onPostExecute(... ) {
        }

        @Override
        protected void onPreExecute (...) {
        }
    }

    private void longRunningMethod() {
        // ...
    }
}
  • 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-07T21:26:37+00:00Added an answer on June 7, 2026 at 9:26 pm

    Safe if not updates the UI, if you’re updating the UI you can use runOnUiThread method.

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

Sidebar

Related Questions

I am calculating something that takes some time. For that I've created an inner
This is just something that's been puzzling me ever since I read about iterators
I'm getting pretty comfortable with git but I've hit something that puzzles me. We
I'm writing a class for solving sudoku puzzles that has some two dimensional arrays
Something that seems to be absent from the otherwise great new features for Windows
Something that I think is really strange is happening when I use die() .
Something that I've noticed recently on two different machines is that Apache2 installed via
Something that has been troubling me for a while: The current wisdom is that
Something that has piqued my interest is Objective-C's BOOL type definition. Why is it
Preferably something that shows the expiration time and authorized resources.

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.