Exactly where do I need to use ProgressDialog?
<p>I am storing data into <code>Gridview</code> via <code>webservice</code>. The web service has lot of data, so it's taking more time. Now, I want to use <code>ProgressDialog</code>. In one activity only, I am calling webservice and storing into <code>Gridview</code>.</p>

<p>Where exactly do I need to use <code>ProgressDialog</code>?
I used soap,my code was </p>

<pre><code>    SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE,
            OPERATION_NAME);

    request.addProperty("APIKey", "e26d30def15054b32d56ada788c85f4c");
    request.addProperty("APIToken", "eaab62dd5dcc2cd5990bfcc77e254e78");
    request.addProperty("zipCode", zcode);
    request.addProperty("isFamily", "1");

    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
            SoapEnvelope.VER11);
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request);

    HttpTransportSE httpTransport = new HttpTransportSE(SOAP_ADDRESS);
    try {


        httpTransport.call(SOAP_ACTION, envelope);
        Object response = envelope.getResponse();

        // textView.setText(response.toString());
        // System.out.println(response.toString());
        // Log.v(LOG_TAG, "we service result = " + response);
    } catch (Exception exception) {
        String exceptionStr = exception.toString();
        // textView.setText(exceptionStr);
        // System.out.println(exceptionStr);
        Log.v("TAG", exceptionStr);
    }

    SoapObject result = (SoapObject) envelope.bodyIn;
    System.out.println(result.toString());

    try {
        final ProgressDialog myDialog1 = new ProgressDialog(Nanny.this);
        SoapObject sopObj;
        // Callig the soap method with param

        sopObj = result;

        SoapObject GetExploretheWallResultSoap = (SoapObject) sopObj
                .getProperty("getCustomersResult");
        Log.e("GetExploretheWallResultSoap value", "getCustomersResult"
                + GetExploretheWallResultSoap.toString());

        // System.out.println("---number---"+
        // GetExploretheWallResultSoap.getPropertyCount());

        SoapObject woiprogrammeSoap = (SoapObject) GetExploretheWallResultSoap
                .getProperty("diffgram");
        Log.e("GetExploretheWallResultSoap value", "schema"
                + woiprogrammeSoap.toString());
        // System.out.println("---number---"+
        // woiprogrammeSoap.getPropertyCount());

        SoapObject woiprogrammeSoap1 = (SoapObject) woiprogrammeSoap
                .getProperty("NewDataSet");
        Log.e("GetExploretheWallResultSoap value", "NewDataSet"
                + woiprogrammeSoap1.toString());
        String woiprogrammeSoap11 = woiprogrammeSoap1.toString();

        System.out.println("no item---------"
                + woiprogrammeSoap1.getPropertyCount());

        Log.e("length  ", "coutn " + woiprogrammeSoap1.getPropertyCount());
        // SoapObject woiprogrammeSoap2 = (SoapObject)
        // woiprogrammeSoap1.getProperty("Table");
        // Log.e("GetExploretheWallResultSoap value","Table"+woiprogrammeSoap2.toString());

        // String woiprogrammeSoap12=woiprogrammeSoap2.toString();

        int numberOfItem = woiprogrammeSoap1.getPropertyCount();
        System.out.println("no item---------" + numberOfItem);
        // int numberOfItem1 = woiprogrammeSoap1.getPropertyCount();
        // System.out.println("no item1---------" + numberOfItem1);
        tv1.setText("we found " + numberOfItem + " families near you");
        System.out.println("------------ss--------"
                + woiprogrammeSoap1.toString());

        for (int i = 0; i &lt; numberOfItem; i++) {

            SoapObject woiprogrammeSoap123 = (SoapObject) woiprogrammeSoap1
                    .getProperty(i);
            System.out.println("------------ss--------"
                    + woiprogrammeSoap1.toString());
            System.out.println("------------ss--------"
                    + woiprogrammeSoap123);

            String woiprogrammeSoap111 = woiprogrammeSoap123.toString();

            String name = woiprogrammeSoap111.substring(
                    woiprogrammeSoap111.indexOf("firstname=") + 10,
                    woiprogrammeSoap111.indexOf(";",
                            woiprogrammeSoap111.indexOf("firstname=")));
            Log.e("", "name  " + name);
            String city = woiprogrammeSoap111.substring(
                    woiprogrammeSoap111.indexOf("city=") + 5,
                    woiprogrammeSoap111.indexOf(";",
                            woiprogrammeSoap111.indexOf("city=")));
            Log.e("", "city  " + city);
            String state = woiprogrammeSoap111.substring(
                    woiprogrammeSoap111.indexOf("stateName=") + 10,
                    woiprogrammeSoap111.indexOf(";",
                            woiprogrammeSoap111.indexOf("stateName=")));
            Log.e("", "state  " + state);
            String zip = woiprogrammeSoap111.substring(
                    woiprogrammeSoap111.indexOf("zip=") + 4,
                    woiprogrammeSoap111.indexOf(";",
                            woiprogrammeSoap111.indexOf("zip=")));
            Log.e("", "zip  " + zip);
            String lastsignin = woiprogrammeSoap111.substring(
                    woiprogrammeSoap111.indexOf("lastsignin=") + 11,
                    woiprogrammeSoap111.indexOf(";",
                            woiprogrammeSoap111.indexOf("lastsignin=")));
            Log.e("", "lastsignin  " + lastsignin);
            String customerid = woiprogrammeSoap111.substring(
                    woiprogrammeSoap111.indexOf("customerid=") + 11,
                    woiprogrammeSoap111.indexOf(";",
                            woiprogrammeSoap111.indexOf("customerid=")));
            Log.e("", "customerid  " + customerid);
            String desiredweeklysalary = woiprogrammeSoap111
                    .substring(
                            woiprogrammeSoap111
                                    .indexOf("desiredweeklysalary=") + 20,
                            woiprogrammeSoap111.indexOf(
                                    ";",
                                    woiprogrammeSoap111
                                            .indexOf("desiredweeklysalary=")));
            Log.e("", "desiredweeklysalary  " + desiredweeklysalary);
            String familyid = woiprogrammeSoap111.substring(
                    woiprogrammeSoap111.indexOf("familyid=") + 9,
                    woiprogrammeSoap111.indexOf(";",
                            woiprogrammeSoap111.indexOf("familyid=")));
            Log.e("", "familyid  " + familyid);
            String JobDate = woiprogrammeSoap111.substring(
                    woiprogrammeSoap111.indexOf("JobDate=") + 8,
                    woiprogrammeSoap111.indexOf(";",
                            woiprogrammeSoap111.indexOf("JobDate=")));
            Log.e("", "JobDate  " + JobDate);
            String r = JobDate.substring(0, 10);
            Log.e("", "JobDate only " + r);

            Details details = new Details(familyid, lastsignin, city,
                    desiredweeklysalary);

            HashMap&lt;String, String&gt; temp = new HashMap&lt;String, String&gt;();
            temp.put("name", name);
            temp.put("state", state);
            temp.put("zip", zip);
            temp.put("JobDate", r);
            list.add(temp);
            all.add(details);

        }

        final SimpleAdapter adapter = new SimpleAdapter(this, list,
                R.layout.customrowview, new String[] { "name", "state",
                        "zip", "JobDate" }, new int[] { R.id.name,
                        R.id.state, R.id.zip, R.id.datee });

        gv.setAdapter(adapter);

        myDialog1.dismiss();

    }

    catch (Exception e) {
        System.out.println(e.toString());

    }



    gv.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView&lt;?&gt; a, View v, int position,
                long id) {
            Object o = gv.getItemAtPosition(position);

            Object o1 = all.get(position);
            Details details = all.get(position);

            String s = gv.toString();

            String familyid = details.Familyid;
            Log.e("", "familyid  " + familyid);

            String lastsignin = details.Lastsignin;
            String city = details.City;
            String desiredweeklysalary = details.Desiredweeklysalary;
            String r1 = lastsignin.substring(0, 10);

            final Dialog myDialog = new Dialog(Nanny.this);

            myDialog.setContentView(R.layout.custom_dialog);

            myDialog.setCancelable(true);

            EditText e1 = (EditText) myDialog.findViewById(R.id.edittext1);
            EditText e2 = (EditText) myDialog.findViewById(R.id.edittext2);
            EditText e3 = (EditText) myDialog.findViewById(R.id.edittext3);
            EditText e4 = (EditText) myDialog.findViewById(R.id.edittext4);

            e1.setText(familyid);
            e2.setText(r1);
            e3.setText(city);
            e4.setText(desiredweeklysalary);

            Button b = (Button) myDialog.findViewById(R.id.button1);
            b.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View v) {

                    myDialog.dismiss();    }    });

            myDialog.show();

        }
    });
</code></pre>
