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

  • Home
  • SEARCH
  • 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 8169541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:52:26+00:00 2026-06-06T20:52:26+00:00

Im currently posting some data to a php webservice using a class that extends

  • 0

Im currently posting some data to a php webservice using a class that extends AsyncTask.

Now i need to make a synchronous call, because i want to show the default exception popup that my app has crashed once the data is sent (previousHandler.uncaughtException(t, e)).

Can i just disable the async functionality on the AsyncTask, or do you have any other suggestions

Here is my current code, thanks in advance:

public void uncaughtException(Thread t, Throwable e) {

    final Writer result = new StringWriter();
    final PrintWriter printWriter = new PrintWriter(result);
    e.printStackTrace(printWriter);
    String stacktrace = result.toString();
    printWriter.close();

    String deviceUuid = Utilities.DeviceUuid(ctx, cr);
    String bluetoothName = Utilities.LocalBluetoothName();

    AsyncTasks.ErrorLogTask logTask = new AsyncTasks.ErrorLogTask(e, bluetoothName, deviceUuid, stacktrace);
    logTask.execute();

    //task wont be complete before this code below runs since its async.

    previousHandler.uncaughtException(t, e);


}
  • 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-06T20:52:28+00:00Added an answer on June 6, 2026 at 8:52 pm

    I think you still need to catch the exception. I would keep the call in your AsyncTask, but catch the exception. Either use a flag as the return value from doInBackground or create a variable local to the AsyncTask to use as a flag, and in your onPostExecute check for the flag and show a dialog if necessary.

    In general you don’t want to make a server call on the main UI thread because of the risk of ANRs. See this article on them:
    http://developer.android.com/guide/practices/responsiveness.html

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

Sidebar

Related Questions

I have a webservice that I need to POST some data to using Qt.
I'm posting some data to a PHP script via jQuery AJAX, and everything executes
We are currently porting some php scripts that are pulling datetimes from the facebook
I'm using the following mysql query to return some data from my database. Currently
I currently have code for posting data to a login page that works fine.
I'm currently using jqGrid to display data. Part of jqGrid's interface will give you
I'm using a Java program to POST some XML data from a remote client
I have a form that I currently enumerate with some Javascript functionality and then
I need to create several screens-forms that would be used for entering data and
Can Anyone put more some light on "data-url" attributes in jQuery Mobile currently I

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.