title: Making 2d array of views fetched from db
body: <p>I am fetching product in cart from database like in image and using code below :-</p>
  
  <pre><code>    public void addToCart(final LinearLayout mycartlist)
          {
  
      db = new DBHandler(getApplicationContext());
      lm = new ListModel();
  
      cartlist.clear();
  
      db.open();
      cartlist = db.getAllCart();
      db.close();
      int vj;
      LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
      for (int i = 0; i &lt; cartlist.size(); i++) {
  
          vj = i;
          view = inflater.inflate(R.layout.addtocartcustom, null);
          holder = new ViewHolder();
          holder.imagecart = (ImageView) view.findViewById(R.id.Imagecart);
          holder.titlecart = (TextView) view.findViewById(R.id.titlecart);
          holder.codecart = (TextView) view.findViewById(R.id.codecart);
          holder.deleteCart = (ImageView) view.findViewById(R.id.deletecart);
          holder.pricecart = (TextView) view.findViewById(R.id.pricecart);
          holder.minuscart = (TextView) view.findViewById(R.id.minuscart);
          holder.pluscart = (TextView) view.findViewById(R.id.pluscart);
          holder.quantitycart = (TextView) view
                  .findViewById(R.id.quantitycart);
  
          byte[] byteArray = cartlist.get(i).getImage();
  
          Bitmap bmp = BitmapFactory.decodeByteArray(byteArray, 0,
                  byteArray.length);
  
          holder.imagecart.setImageBitmap(bmp);
          holder.titlecart.setText(cartlist.get(i).getTitle());
             holder.codecart.setText(cartlist.get(i).getCode());
  
  
          double s;
  
          double s1;
  
          holder.quantitycart.setText(cartlist.get(i).getQuantity());
  
  
          s = cartlist.get(i).getPrice();
  
  
          s1 = s * Double.parseDouble(cartlist.get(i).getQuantity());
          holder.pricecart.setText(String.valueOf(s1));
  
  
  
  
  
          AddTocart.total(AddTocart.this, String.valueOf(s1));
  </code></pre>
  
  <p>I am fetching product id , price etc from database . 
  Now what i need to do is store all views in a 2d array like :-</p>
  
  <pre><code>[productlist] =&gt; Array
      (
          [0] =&gt; Array
              (
                  [product_id] =&gt; 560
                  [quantity] =&gt; 1
              )
  
          [1] =&gt; Array
              (
                  [product_id] =&gt; 561
                  [quantity] =&gt; 2
              )
  
          [2] =&gt; Array
              (
                  [product_id] =&gt; 477
                  [quantity] =&gt; 3
              )
  
      )
  </code></pre>
  
  <p>Please help ..</p>