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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:06:46+00:00 2026-06-03T08:06:46+00:00

I have a simple android application to access a web service. I want to

  • 0

I have a simple android application to access a web service. I want to show a dialog "Loading . . ." until results are loaded and dismissed after loading the results. I have used this code but this doesn’t show the loading message:

public class LoadingActivity extends Activity {
   private static final String SOAP_ACTION = "http://ws.eretailer.com/";
   private static final String METHOD_NAME = "dataSender";
   private static final String NAMESPACE = "http://ws.eretailer.com/dataSender/";
   private static final String URL = "http://175.157.128.207:8085/Eretailer/services/EretailerService?wsdl";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    final ProgressDialog pd = new ProgressDialog(this);
    pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    pd.setMessage("Loading. . .");
    pd.show();
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);          

    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

    envelope.setOutputSoapObject(request);
    pd.show();
    HttpTransportSE ht = new HttpTransportSE(URL);
    try {

        ht.call(SOAP_ACTION, envelope);
        SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
        SoapPrimitive s = response;

        pd.dismiss();
           String str = s.toString();
           String arr1[] = str.split(" ");

           TextView tv = new TextView(this);

           for(int i = 0; i<arr1.length;i++){
           tv.append("order ID :"+arr1[i]+"\n");
          }
           setContentView(tv);

       } catch (Exception e) {

           e.printStackTrace();
       }
}
}

How can I correct this problem ?

  • 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-03T08:06:47+00:00Added an answer on June 3, 2026 at 8:06 am

    Hi try as following code

     private class DownloadWebPageTask extends AsyncTask<String, Void, String> {
        @Override
        protected void onPreExecute() {
            pd.show();
            super.onPreExecute();
        }
        @Override
        protected String doInBackground(String... urls) {
            String response = "";
             HttpTransportSE ht = new HttpTransportSE(URL);
                try {
    
                    ht.call(SOAP_ACTION, envelope);
                    SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
                    SoapPrimitive s = response;
    
                    pd.dismiss();
                       String str = s.toString();
                       String arr1[] = str.split(" ");
    
                       TextView tv = new TextView(this);
    
                       for(int i = 0; i<arr1.length;i++){
                       tv.append("order ID :"+arr1[i]+"\n");
                      }
                       setContentView(tv);
    
                   } catch (Exception e) {
    
                       e.printStackTrace();
                   }
            return response;
        }
    
        @Override
        protected void onPostExecute(String result) {
            pd.dismiss();
        }
    }
    

    Resource : http://www.vogella.com/articles/AndroidPerformance/article.html

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

Sidebar

Related Questions

I have a simple string with Chinese characters in my Android application and want
I have a simple Android application that uses a JAR I have built. When
I have a simple client-server app on android. the android service communicates with the
In my Android application, I have a simple list view with adapter. There's a
I have a couple of simple tests, like assertNotNull(mActivity); (I'm reading M.D.Torres Android Application
I have written a simple Android application that uses a sqlite database which is
I want to build a fairly simple Android application. The basic data model of
Good Evening, I have been trying to implement a simple Android(tm) application that utilizes
I have a simple Android native java application that reads data from a Bluetooth
I have written one simple Android Tetris application. After it I decided to read

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.