XML : xml to listview calculate

prc.xml

  <?xml version="1.0" encoding="utf-8"?>  <resources>      <string-array name="productlar">          <item>product1</item>          <item>product2</item>          <item>product3</item>          <item>product4</item>      </string-array>      <string-array name="prices">          <item>43.99</item>          <item>42.66</item>          <item>41.61</item>          <item>40.47</item>      </string-array>  </resources>    

I'm trying to find the code for a few nights but did not get a result. I can transfer to prices prc.xml to listview with following code. But this code only conveys the same products to listview.

   ListView fiyatlistele=(ListView)findViewById(R.id.listView);   String[] arrayim=getResources().getStringArray(R.array.prc);   ArrayAdapter<String> adapter=new ArrayAdapter<String>           (this,android.R.layout.simple_list_item_1,arrayim);   fiyatlistele.setAdapter(adapter);    

I have to calculate the product final price before transfer to listview. Example: all products prices(in xml) must be multiplied by 2 then transfer to listview. (It will change the final price according to the customer)

No comments:

Post a Comment