title: total cannot be resolved to a type in Android
body: <p>I am trying to <strong>get value for total from Adapter class to Activity class</strong>, but i am getting an error message:</p>
  
  <pre><code>   total cannot be resolved to a type
  
     // here i am getting total cannot be resolved to a type
  Double mGTotal = Double.parseDouble(Constants.mItem_Detail.get(0).get(total)); // total (single) &gt; CartAdapter
  </code></pre>
  
  <p><strong>CartAdapter.java:</strong></p>
  
  <pre><code>  public View getView(final int position, View convertView, ViewGroup parent) {
      // TODO Auto-generated method stub
      View vi = convertView;
      if (convertView == null)
          vi = inflater.inflate(R.layout.listrow_cart, null);
  
      TextView title = (TextView) vi.findViewById(R.id.title);
      final TextView cost = (TextView) vi.findViewById(R.id.cost);
      final TextView qty = (TextView) vi.findViewById(R.id.qty);
      final TextView total = (TextView) vi.findViewById(R.id.total);
  
  
      ImageButton mImgBtnDelete = (ImageButton) vi
              .findViewById(R.id.mImgBtnDelete);
  
      mImgBtnDelete.setOnClickListener(new OnClickListener() {
  
          public void onClick(View v) {
              // TODO Auto-generated method stub
  
              Constants.mItem_Detail.remove(position);
              notifyDataSetChanged();
  
              Intent mInViewCartRefresh = new Intent(activity,
                      CartActivity.class);
              activity.startActivity(mInViewCartRefresh);
              activity.finish();
          }
      });
  
      HashMap&lt;String, String&gt; item = new HashMap&lt;String, String&gt;();
      item = Constants.mItem_Detail.get(position);
  
      // Setting all values in listview
      title.setText(item.get(restra.second.erachnida.menus.ProductInformationActivity.KEY_TITLE));
      cost.setText(item.get(restra.second.erachnida.menus.ProductInformationActivity.KEY_COST));
      qty.setText("1");
      qty.addTextChangedListener(new TextWatcher() {
  
          public void onTextChanged(CharSequence s, int start, int before,
                  int count) {
              // TODO Auto-generated method stub
              if (!qty.getText().toString().equals("")
                      || !qty.getText().toString().equals("")) {
                  int itemquantity = Integer.parseInt(qty.getText()
                          .toString());
                  double itemamount = Double.parseDouble(cost.getText()
                          .toString());
                  total.setText(new DecimalFormat("##.##").format(itemamount*itemquantity));
              } else {
                  total.setText("0.00");
              }
          }
  
          public void beforeTextChanged(CharSequence s, int start, int count,
                  int after) {
              // TODO Auto-generated method stub
  
          }
  
          public void afterTextChanged(Editable s) {
  
          }
      });
  </code></pre>
  
  <p><strong>CartActivity.java:</strong></p>
  
  <pre><code>     public class CartActivity extends Activity 
      {
  
  TextView mTxtViewGrandTotal;
  TextView myTextVeiwGrandTotal;
  
  TextView mItems;
  String mGrandTotal;
  String mTotal;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_cart);
  
      ListView mLstView1 = (ListView) findViewById(R.id.listView1);
  
      mTxtViewGrandTotal = (TextView) findViewById(R.id.billing_amount);
      myTextVeiwGrandTotal = (TextView) findViewById(R.id.total_amount);
      mItems = (TextView) findViewById(R.id.total_items);
  
      CartAdapter mViewCartAdpt = new CartAdapter(CartActivity.this);
      mLstView1.setAdapter(mViewCartAdpt);
  
  
      if (Constants.mItem_Detail.size() &gt; 0) 
      {
           // here i am getting total cannot be resolved to a type
          Double mGTotal = Double.parseDouble(Constants.mItem_Detail.get(0).get(total)); // total (single) &gt; CartAdapter
          for (int i = 1; i &lt; Constants.mItem_Detail.size(); i++) 
          {   
          mGTotal = mGTotal + Double.parseDouble(Constants.mItem_Detail.get(i).get(total));  // total (all) &gt; CartAdapter
          }
          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>