Page 111 - 3-2
P. 111

}
                /**
                 * Background Async Task to Load all product by making HTTP Request
                 * */
                class LoadAllProducts extends AsyncTask<String, String, String> {


                    /**
                     * Before starting background thread Show Progress Dialog


                    @Override
                    protected void onPreExecute() {
                        super.onPreExecute();
                        pDialog = new ProgressDialog(MainActivity_owner_list.this);
                        pDialog.setMessage("Loading products. Please wait...");
                        pDialog.setIndeterminate(false);
                        pDialog.setCancelable(false);
                        pDialog.show();


                        Log.d(" 여긴가", "owner_9-4");
                    }    */


                    /**
                     * getting All products from url
                     */
                    protected String doInBackground(String... args) {
                        // Building Parameters
                        List<NameValuePair> params = new ArrayList<NameValuePair>();
                        // getting JSON string from URL
                        Log.d(" 여긴가","owner_2-1,  들어 옴");
                        JSONObject json = jParser.makeHttpRequest(url_all_products, "GET", params);


                        // Check your log cat for JSON reponse
                        Log.d("All Products: ", json.toString());
                        Log.d(" 여긴가","owner_2-2,  출력하러 옴");
                        Log.d(" 여긴가",json.toString());


                        try {
                            // Checking for SUCCESS TAG
                            int success = json.getInt(TAG_SUCCESS);
                            Log.d(" 여긴가","owner_2-3,try  들어옴");


                            if (success == 1) {
                                Log.d(" 여긴가","owner_2-4,success   는 1");
                                // products found
                                // Getting Array of Products


                                                         - 111 -
   106   107   108   109   110   111   112   113   114   115   116