title: Multiply price and quantity in custom listview in android
body: <p>I am fetching an array which displays itemimage, itemname, price, qty in a custom listview. Now I am placing one more field, total, which is calculated by multiplying price and quantity.</p>
  
  <p>I am using this code:   </p>
  
  <pre><code>public class CustomAdapter extends BaseAdapter
    {
      integer[] a;
  public static ArrayList&lt;String&gt; arr1=new ArrayList&lt;String&gt;();
  public static ArrayList&lt;String&gt; itemprice=new ArrayList&lt;String&gt;();
  public static ArrayList&lt;Bitmap&gt; itemimage=new ArrayList&lt;Bitmap&gt;();
  public Context Context;
  private LayoutInflater inflater;
  String total;
      HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
      public CustomAdapter(Context context, ArrayList&lt;String&gt; arr,ArrayList&lt;String&gt; price,ArrayList&lt;Bitmap&gt; image) 
      {
          Context=context;
          inflater=LayoutInflater.from(context);
          arr1=arr;
          itemprice=price;
          itemimage=image;
          System.out.println(itemprice);
          System.out.println("arr: " + arr.size());
  
        for(int i=0;i&lt;price.size();i++)
        {
  
            String amonut=price.get(i);
            int x=Integer.parseInt(amonut);
  
        }
  
      }
      public int getCount() 
      {
          // TODO Auto-generated method stub
          return arr1.size();
  
      }
  
      public Object getItem(int position) 
      {
          // TODO Auto-generated method stub
          return arr1.get(position);
      }
  
      public long getItemId(int position) 
      {
          // TODO Auto-generated method stub
          return position;
      }
  
      public View getView(int position, View convertView, ViewGroup parent) 
          {
          System.out.println(arr1.get(position));
  
            final  ViewHolder holder;
  
              if (convertView == null) 
              {
                  convertView = inflater.inflate(R.layout.selecteditemlistview, null);
                  holder = new ViewHolder();
  
                  holder.textViewSelectedText = (TextView)convertView.findViewById(R.id.selectedtext);
                  holder.price=(TextView)convertView.findViewById(R.id.selectitemprice);
                  holder.image=(ImageView)convertView.findViewById(R.id.selectitemimagge);
                  holder.qty=(EditText)convertView.findViewById(R.id.selectqty);
                  holder.total=(TextView)convertView.findViewById(R.id.totalamount);
                  convertView.setTag(holder);
              }
              else 
              {
                  holder = (ViewHolder) convertView.getTag();
              }
              String amount=holder.qty.getText().toString();
  
              holder.textViewSelectedText.setText(arr1.get(position));
              holder.price.setText(itemprice.get(position));
              holder.image.setImageBitmap(itemimage.get(position));
  
              return convertView;     
          }
  
          class ViewHolder
          {
              TextView textViewSelectedText = null;
              TextView price=null;
              ImageView image=null;
              EditText qty=null;
              TextView total=null;
          }      
   }
  </code></pre>
  
  <p>I want to multiply int x and String amount and assign the result as text to total.</p>