title: How to Iterate over entire android listview
body: <p>I have a listview where user choose how much for each item he wants, so I need to iterate over each row to get the name (Ovo, Presunto, Queijo, etc), the quantity (the number between the "+" and "-" buttons) and the price. This is already working fine, but I have the following problem: If you look at the bottom of the listview you can know that there are more items, in this picture there are 9 items, but there are 15, and if the user scrolls I will can not iterate over the "hidden" items of listview. </p>
  
  <p><a href="https://i.stack.imgur.com/hy92n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hy92n.png" alt="My listview"></a></p>
  
  <p>Today I have this code, where I try iterate over the elements of listview:</p>
  
  <pre><code>for (int i = 0; i &lt; listView.getCount(); i++) {
          v = listView.getChildAt(i);
          if(v != null){
              value = (TextView) v.findViewById(R.id.edOptionValue);
              nome = (TextView) v.findViewById(R.id.tvOptionName);
              tvPrice = (TextView) v.findViewById(R.id.tvPrice);
              String price = tvPrice.getText().toString();
  
              //more code here
      }
  }
  </code></pre>
  
  <p>listView.getCount() gets the correct number of items (15 items), but when i==10 listView.getChildAt(i) is getting null.</p>
  
  <p>Is there some way to iterate over all items of a listview, incluing the "hidden" elements ?</p>