How do I Show Updated Quantity in Cart Activity
<p>I am making an app, in which i am allowing user to choose a <strong>product to buy</strong> and then <em>see details of your selected items</em>, for this i am providing <strong>two tabs</strong>, first for <strong>Menus</strong> and second for <strong>Cart</strong></p>

<p>Now problem is whenever i update quantity for an item, which i already added to cart, i am not getting updated quantity but getting effect on Total Amount,</p>

<p>In short, updated quantity is not showing up, but getting changes in price as i change quantity of an item</p>

<p><em>but whenever i update quantity before moving to Cart Tab i am not facing this kind of problem, it means when i move to Cart Tab and see details of selected items and then go back to Menu Tab to update quantity, here i am facing this small issue</em></p>

<p>Please see my code below:</p>

<p>SingleProductActivity.java:</p>

<pre><code>ImageButton mImgAddCart = (ImageButton) findViewById(R.id.img_add);
                mImgAddCart.setOnClickListener(new OnClickListener() 
                {

                    public void onClick(View v) {
                        // TODO Auto-generated method stub
                    //  song_name = txttitle.getText().toString();
                        duration = text_cost_code.getText().toString();
                        duration = duration.replace("From ", "");
                        mTotal = txt_total.getText().toString();
                        mTotal = mTotal.replace("From ", "");
                        mQty = edit_qty_code.getText().toString();

                        if (Constants.mItem_Detail.size() &lt;= 0) {
                            HashMap&lt;String, String&gt; mTempObj = new HashMap&lt;String, String&gt;();
                            mTempObj.put(TAG_NAME, song_name);
                            mTempObj.put(KEY_QTY, mQty);
                            mTempObj.put(TAG_DURATION, duration);
                            mTempObj.put(KEY_TOTAL, mTotal);

                            Constants.mItem_Detail.add(mTempObj);   
                        }
                        else
                        {
                            for (int i = 0; i &lt; Constants.mItem_Detail.size(); i++) {
                                if (Constants.mItem_Detail.get(i).get(TAG_NAME)
                                        .equals(song_name)) {
                                    Constants.mItem_Detail.remove(i);


                                    break;

                                } 
                                else
                                {

                                }
                            }
</code></pre>

<p>ViewCartActivity.java:</p>

<pre><code>   @Override
    protected void onResume() 
    {
        super.onResume();
        if (Constants.mItem_Detail.size() == 0) 
        {
            return;
        }

        Double mGTotal = Double.parseDouble(Constants.mItem_Detail.get(0).get(SingleProductActivity.KEY_TOTAL));
        for (int i = 1; i &lt; Constants.mItem_Detail.size(); i++) 
        {   
        mGTotal = mGTotal + Double.parseDouble(Constants.mItem_Detail.get(i).get(SingleProductActivity.KEY_TOTAL));
        }
        mGrandTotal = String.valueOf(mGTotal);
        mTxtViewGrandTotal.setText(mGrandTotal);
        myTextVeiwGrandTotal.setText(mGrandTotal);
        mTxtViewGrandTotal.setText(new DecimalFormat("##.##").format(mGTotal));
        mTotal = String.valueOf(Constants.mItem_Detail.size());
        mItems.setText(mTotal);

}
  }
</code></pre>
