title: how to get sum of integer value from recyclerview
body: <p>i am want to implement something like invoice. i am using recyclerview in fragment. and textview. i have some item in recyclerview. which content title,unit and price. now i want to get sum of all item's price in my textview which is in fragment. here is image what i want to achive.</p>
  <p>here is image for understanding</p>
  <p><a href="https://i.stack.imgur.com/59ORW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/59ORW.png" alt="enter image description here" /></a></p>
  <p>here is my code for adapter class</p>
  <pre><code>public class Checkout_fragment2_confermation_Adapter extends RecyclerView.Adapter&lt;Checkout_fragment2_confermation_Adapter.ViewHolder&gt;  {
  
  static List&lt;Cart_datamodel&gt; data;
  static Context context;
  
  public Checkout_fragment2_confermation_Adapter(Context context , List&lt;Cart_datamodel&gt; data1) {
      data = new ArrayList&lt;Cart_datamodel&gt;();
      this.context = context;
      this.data = data1;
  }
  
  
  @Override
  public Checkout_fragment2_confermation_Adapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      final View itemLayoutView = LayoutInflater.from(parent.getContext()).inflate(R.layout.checkout_fragmet2confermation_listviwe_single_row, null);
      itemLayoutView.setLayoutParams(new RecyclerView.LayoutParams(RecyclerView.LayoutParams.MATCH_PARENT, RecyclerView.LayoutParams.WRAP_CONTENT));
      Checkout_fragment2_confermation_Adapter.ViewHolder viewHolder = new Checkout_fragment2_confermation_Adapter.ViewHolder(itemLayoutView);
  
      return viewHolder;
  }
  
  @Override
  public void onBindViewHolder(Checkout_fragment2_confermation_Adapter.ViewHolder holder, int position) {
  
      holder.title.setText(data.get(position).getTitle());
      holder.price.setText(data.get(position).getPrice());
      holder.product_img.setImageBitmap(getImage(data.get(position).getImg()));
  
  
  }
  
  @Override
  public int getItemCount() {
      return data.size();
  }
  
  public class ViewHolder extends RecyclerView.ViewHolder {
      public TextView  title,price;
      public ImageView img,product_img;
  
      public ViewHolder(View itemView) {
          super(itemView);
          title = (TextView)itemView.findViewById(R.id.title_checkout_fgment2);
          price =(TextView)itemView.findViewById(R.id.price_checkout_fragment2);
          product_img =(ImageView)itemView.findViewById(R.id.image_checkout_fragment2);
      }
  }
  public static Bitmap getImage(byte[] image) {
      return BitmapFactory.decodeByteArray(image, 0, image.length);
  }
  
  }
  </code></pre>
  <p>here is my fragment class</p>
  <pre><code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      view = inflater.inflate(R.layout.fragmenttab2, container, false);
  
      dataBaseAdapter = new AddressDataBaseAdapter(getContext());
      cart_adapter = new Item_adding_cart(getContext());
      dbList = cart_adapter.getDataFromDB();
  
     // listview = (ListView)view.findViewById(R.id.listview);
  
      recyclerView =(RecyclerView)view.findViewById(R.id.my_recycler_view_checkout_fgrment2);
      recyclerView.setHasFixedSize(true);
      recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
      recycleradapter = new Checkout_fragment2_confermation_Adapter(getContext(),dbList);
      recyclerView.setAdapter(recycleradapter);
  
  
  
      fname =(TextView)view.findViewById(R.id.firstname_conformation);
      lname =(TextView)view.findViewById(R.id.lastname_conformation);
      mobile =(TextView)view.findViewById(R.id.mobile_conformaton);
      address =(TextView)view.findViewById(R.id.address_conformation);
      zipcode =(TextView)view.findViewById(R.id.zipcode_conformation);
      city =(TextView)view.findViewById(R.id.city_conformation);
  
  
  
  
      addresslist= new ArrayList&lt;Address_Activity_DataModel&gt;();
      addresslist=dataBaseAdapter.getDataFromDB();
  
      int count = dataBaseAdapter.getrowcount();
      if(count==0){
  
      }
      else
      {
          showRecords();
      }
  
     // loaddata();
  
  
  
      return view;
  
  }
  </code></pre>