Page 112 - 3-2
P. 112

products = json.getJSONArray(TAG_PRODUCTS);


                                // looping through All Products
                                for (int i = 0; i < products.length(); i++) {
                                    JSONObject c = products.getJSONObject(i);
                                    Log.d(" 여긴가","owner_2-5,for  문들어옴");


                                    // Storing each json item in variable
                                    String code = c.getString(TAG_CODE);
                                    String name = c.getString(TAG_NAME);
                                    String num = "1";
                                    String price = c.getString(TAG_PRICE);


                                    //owner_compare_price+=Integer.valueOf(price).intValue();


                                    // creating new HashMap
                                    HashMap<String, String> map = new HashMap<String, String>();


                                    // adding each child node to HashMap key => value
                                    map.put(TAG_CODE, code);
                                    map.put(TAG_NAME, name);
                                    map.put(TAG_PRICE, price);




                                    // adding HashList to ArrayList
                                    productsList2.add(map);


                                }
                                Log.d(" 여긴가","owner_2-6,for  문 끝남");
                                //sum_price=sum_price+Integer.parseInt(price);
                              // owner_compare_all_price=owner_compare_price;


                              // owner_compare_price=0;
                            } else {
                                Log.d(" 여긴가", "owner_2-77_   너 혹시 else   니???");
                                // no products found
                                // Launch Add New product Activity
                                Intent i = new Intent(getApplicationContext(),
                                        MainActivity_owner_list.class);
                                // Closing all previous activities
                                i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                                startActivity(i);
                            }
                        } catch (JSONException e) {
                            Log.d(" 오류남: ", e.getMessage());


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