Listview again loads data through notifyDatasetChanged after some time in android
<p>I have a problem that I am loading a listview with a lazyadapter and it is working fine, but when we update data through notifyDataSetChanged method of adapter thelistview hangs for some time and shows only two data after some time when we left idle the screen then it shows more data in the listview. Means it allowing us to scroll the same. I don't know why? Please suggest me any solution regarding the same.</p>

<p><strong>Code:</strong></p>

<pre><code>public void setValuesInCategoryChildSortByPrice(String url,
            final String filter, final String from, final String to) {
        if (isOnline()) {
            final ProgressDialog dialog = ProgressDialog.show(
                    ResearchList.this, "Research List       ",
                    "Please wait...   ", true);

            final Handler handler = new Handler() {

                public void handleMessage(Message msg) {

                    // System.out.println("The id after Save:"+id.get(0).toString());

                    // catagory.addAll(keyword_vector1);
                    linear_Category_Child.setVisibility(View.GONE);
                    linear_Category_Child_Child.setVisibility(View.VISIBLE);
                    // tv_Child_Header.setText("Volvo");
                    /*
                     * adapter = new CategoryListLazyAdapter(
                     * ResearchList.this); lvCategory.setAdapter(adapter);
                     */
                    demoAdapterCat.notifyDataSetChanged();
                    //Utility util = new Utility();
                    Utility.setListViewHeightBasedOnChildren(lvCategory);
                    dialog.dismiss();
                }
            };

            final Thread checkUpdate = new Thread() {

                public void run() {
                    try {
                        String sortEncode = URLEncoder.encode("price");
                        String filterEncode = URLEncoder.encode(filter);
                        String clientEncode = URLEncoder.encode("10030812");
                        String fromEncode = URLEncoder.encode(from);
                        String toEncode = URLEncoder.encode(to);
                        String catUrl = "/v1/vehicles/get-make-models.json?sort="
                                + sortEncode
                                + "&amp;filter="
                                + filterEncode
                                + "&amp;client-id="
                                + clientEncode
                                + "&amp;from="
                                + fromEncode;
                        genSig = new GetSignature(catUrl, "acura");
                        try {
                            signature = genSig.getUrlFromString();
                        } catch (InvalidKeyException e1) {
                            // TODO Auto-generated catch block
                            e1.printStackTrace();
                        } catch (NoSuchAlgorithmException e1) {
                            // TODO Auto-generated catch block
                            e1.printStackTrace();
                        }
                        // jsonString =
                        // getJsonSring("http://api.highgearmedia.com/v1/vehicles/get-models.json?make=acura&amp;client-id=10030812&amp;signature=LWQbdAlJVxlXZ1VO2mfqAA==");
                        // String signatureEncode =
                        // URLEncoder.encode(signature);
                        String urlEncode = URLEncoder.encode(catUrl
                                + "&amp;signature=" + signature);
                        jsonString = getJsonSring("http://apibeta.highgearmedia.com"
                                + catUrl + "&amp;signature=" + signature);
                        System.out.println("The json category:===&gt;"
                                + jsonString);
                    } catch (ClientProtocolException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    } catch (URISyntaxException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                    JsonParse json = new JsonParse(jsonString);
                    json.parseCat();
                    handler.sendEmptyMessage(0);

                }

            };
            checkUpdate.start();
        } else {
            AlertDialog.Builder builder = new Builder(ResearchList.this);
            builder.setTitle("Attention!");
            builder.setMessage("Network Connection unavailable.");
            builder.setPositiveButton("OK",
                    new DialogInterface.OnClickListener() {

                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            // TODO Auto-generated method stub

                        }
                    });

            builder.create().show();
        }

    }
</code></pre>
