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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:26:23+00:00 2026-05-25T02:26:23+00:00

In Android I am using a service to fetch data from a web service

  • 0

In Android I am using a service to fetch data from a web service and update the sqlite database with the fetched data.

    class IncomingHandler extends Handler {
    @Override
    public void handleMessage(Message msg) {
        switch (msg.what) {
        case MSG_UPDATE_DATABASE:
            UpdateListThread thread = new UpdateListThread();
            thread.start();
            try {
                msg.replyTo.send(Message.obtain(null, MSG_UPDATE_DATABASE));
            } catch (RemoteException e) {
                // client is destroyed
            }
            break;
        default:
            super.handleMessage(msg);
        }
    }

However, If the web service returns an error, I want to throw an Exception and handle the Exception in the UI thread (which binds to this service), so I can print the Exception message on the screen.

Is this possible to do?

TIA,

  • 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-05-25T02:26:23+00:00Added an answer on May 25, 2026 at 2:26 am

    The recommended method in this case is to use either Toast or Notification objects to notify user. As I understand your program’s logic correctly, you just need to pass Exception‘s message to one of cited object’s constructor and initiate it.

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

Sidebar

Related Questions

I have an Android app that fetches data from the web service using ksoap2,
I'm consuming a web service from an Android device using HTTP(s) with SSL. A
I'm trying to call a RESTful web service from an Android application using the
My Android application is expecting and array of usernames from my WCF Service using
I'm using ksoap2 for web service method calls. I used ksoap2-android-assembly-2.5.4-jar-with-dependencies.jar and was able
I'm using KSoap within my Android application. My application using Web Service for communicate
Hello I am trying to start the android browser from a service using this
I wrote some android application that get xml from some service ( using http
I am developing android application. I am using the web service to retrive the
I'm trying to use custom notifications in my Android application using Google's sample from

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.