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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:50:17+00:00 2026-06-12T21:50:17+00:00

I have an AsyncTask in my program that seems to stop after onPreExecute() ,

  • 0

I have an AsyncTask in my program that seems to stop after onPreExecute(), after the app is run several times. What I mean is, I can use the app and everything works about 10-20 runs, but then it halts. Here is what’s going on:

private class MyTask extends AsyncTask<String, Void, Data> {

    protected void onPreExecute() {
        // show loading dialog
        Log.d(TAG, "end onPreExecute");
    }

    protected Data doInBackground(String... params) {
        Log.d(TAG, "start doInBackground");
        // do stuff
    }

    protected void onPostExecute(Data myData) {
        // do stuff
    }

}

When it stops working, what happens is that the loading dialog just keeps loading forever, and "end onPreExecute" prints but "start doInBackground" does not.

Why might that be?

  • 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-12T21:50:18+00:00Added an answer on June 12, 2026 at 9:50 pm

    It’s hard to tell where the problem is. As your Async Task seems to work the first couple of times, it could be that this API-feature is just too “unstable” for your intention…

    A solution for your issue could simply be, to replace the AsyncTask by a different Thread solution:

    • Here is a post where this issue was solved by a traditional Thread.
    • Here is a post which shows how to use an Handler.

    Hope that helps!

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

Sidebar

Related Questions

My goal is to have an AsyncTask that can execute multiple times (one task
i have an AsyncTask that gets executed when the app starts up. on a
I have a progress dialog that I use for a part in my program
I have an AsyncTask and on the background I want to start Service that
I have been using Asynctask most of time, but in the current app the
I have a class that extends AsyncTask , which fetches the gps cordinates from
I have an asynctask that parses an xml file from the net. I'm storing
I have an AsyncTask that get info from the web. Sometimes the connection fails
I have an AsyncTask that queries a content provider and does some additional processing
I have an AsyncTask that is executed before I move on to the next

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.