title: Android how to update list items with a while loop?
body: <p>I have a list in witch I have only money amounts (numbers), then I want to create a while loop to pull each item in the list (or amount) to be able to do a calculation like adding the tax to the amount and inserting this new amounts to another list in the same order as the original list.</p>
  
  <p>this is my code:</p>
  
  <pre><code>final ArrayList&lt;Double&gt; individuallist = new ArrayList&lt;Double&gt;();
  final ArrayAdapter&lt;Double&gt; bb;
  bb = new ArrayAdapter&lt;Double&gt;(this,android.R.layout.simple_list_item_1 ,individuallist);
  listView.setAdapter(bb);
  </code></pre>
  
  <p>//button Next</p>
  
  <pre><code>    Button next = (Button) findViewById(R.id.btnnext);
      next.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
  
              counter2 = itotal;
              individuallist.add(0, counter2);
              bb.notifyDataSetChanged();
              item1.setText("0");
  
          }
      });    
  </code></pre>
  
  <p>the itotal comes from a edit text view</p>
  
  <p>so I have another button where I want to create a click event to do the while loop so I can add tax to every amount place the result in another list in the same order and display it in a second list view, so I don't modify the first list items so I can change the tax rate later and be able to modify the second list every time the second button is press and display the second list updated.</p>
  
  <p>Thanks</p>