How can I change the color dynamically in listview base on the value from xml parse?
<p>Here's I want to code.</p>

<p>Pay the girl = 100 the value of the 100 (100 is the value from XML file in the browser) = is color red </p>

<p>Pay the girl = 200 the value of the 200  (200 is the value from XML file in the browser) = is color green </p>

<p>Pay the boy = 100 the value of the  100 (100 is the value from XML file in the browser) = is color red</p>

<p>Pay the boy = 200 the value of the 200 (200 is the value from XML file in the browser) = is color green</p>

<p>Where if higher value from the XML file in the browser like 200 the color of 200 in the list-view is green while the lower value from the XML file in the browser like 100 the color of 100 in the list-view is red. the value its is change depends in the XML file in the browser. I'm using DOM parser to get the value of pay the boy and pay the girl and I'm using also Timer to auto refresh it in seconds. How can I put the code of my asking changing color in my code XML parse with timer? I do some thing in that but I'm failed.</p>

<p>here's the code</p>

<pre><code>@Override
         public void onResume() {
          super.onResume();
          Timer autoUpdate = new Timer();
          autoUpdate.schedule(new TimerTask() {
           @Override
           public void run() {
            runOnUiThread(new Runnable() {
             public void run() {
                 ArrayList&lt;HashMap&lt;String, String&gt;&gt; menuItems = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();

                 quotesXMLParsing parser = new quotesXMLParsing();
                String xml = parser.getXmlFromUrl(URL); // getting XML
                Document doc = parser.getDomElement(xml); // getting DOM element

                NodeList nl = doc.getElementsByTagName(KEY_item);
                // looping through all item nodes &lt;item&gt;
                for (int i = 0; i &lt; nl.getLength(); i++) {
                    // creating new HashMap
                    HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
                    Element e = (Element) nl.item(i);
                    // adding each child node to HashMap key =&gt; value
                    map.put(KEY_price, parser.getValue(e, KEY_price));
                    map.put(KEY_pay of the girl, parser.getValue(e, KEY_pay of the girl));
                    map.put(KEY_pay of the boy,  parser.getValue(e, KEY_pay of the boy));


                    // adding HashList to ArrayList
                    menuItems.add(map);
                }

                // Adding menuItems to ListView
                ListAdapter adapter = new SimpleAdapter(Activity.this, menuItems,
                        R.layout.showquotes,
                        new String[] { KEY_price, KEY_pay of the girl, KEY_pay ogf the boy }, new int[] {
                                R.id.price, R.id.pay of the girl, R.id.pay of the boy });

                setListAdapter(adapter);
             }
            });
           }
          }, 0, 5000); 
         }
}
</code></pre>

<p>here's the XML file</p>

<pre><code>&lt;items&gt;
&lt;item&gt;
&lt;price&gt;100&lt;/price&gt;
&lt;pay of the girl&gt;100&lt;/pay of the girl&gt;
&lt;pay of the boy&gt;200&lt;/pay of the boy&gt;
&lt;/item&gt;
</code></pre>

<p>the value like 100 and 200 change every 5 seconds</p>

<p>here's I tried the code but I failed.</p>

<pre><code>ListAdapter adapter = new SimpleAdapter(Activity.this, menuItems,
                        R.layout.showquotes,
                        new String[] { KEY_price, KEY_pay of the girl, KEY_pay ogf the boy }, new int[] {
                                R.id.price, R.id.pay of the girl, R.id.pay of the boy });               


            ListAdapter.setViewBinder(new MyViewBinder1());           
            itemlist.setAdapter(ListAdapter);



 class MyViewBinder1 implements ViewBinder 
 {      @Override
            public boolean setViewValue(View view, Object Status,String textRepresentation)
            {       
                  String complet="Pay of the girl:+higher ";
                  String complet1="Pay of the boy:+higher";
          String notcomplet="Pay of the girl:-lower";
                  String notcomlet="Pay of the boy:-lower";


                  String getdata= textRepresentation;


                    if((view instanceof TextView) &amp; (Status instanceof String) )
                    { 
                            TextView iv= (TextView) view;     
                            if(complet.equals(Status))
                                {
                                r1=true;
                                r2=false;
                            iv.setText(textRepresentation);       
                            iv.setTextColor(Color.parseColor("#008000"));                
                            return true;
                           }   
                            else if(notcomlet.equals(Status))
                            {
                                r2=true;
                                r1=false;
                                iv.setText(textRepresentation);       
                                iv.setTextColor(Color.RED); 
                                return true;
                            }

                            if(r1 &amp;&amp; (getdata.startsWith("Pay of the girl:   ")))
                           {                            

                            iv.setText(textRepresentation);      

                            iv.setTextColor(Color.parseColor("#008000"));                           
                            return true;
                           }
                if(r1 &amp;&amp; (getdata.startsWith("Pay of the boy:   ")))
                           {                            

                            iv.setText(textRepresentation);      

                            iv.setTextColor(Color.parseColor("#008000"));                           
                            return true;
            {
                        else if (r2 &amp;&amp; (getdata.startsWith("Pay of the girl:   ")))
                        {
                            //TextView iv= (TextView) view;
                            iv.setText(textRepresentation);       
                            iv.setTextColor(Color.RED);                              
                            return true;
                        }
            else if (r2 &amp;&amp; (getdata.startsWith("Pay of the boy:   ")))
                        {
                            //TextView iv= (TextView) view;
                            iv.setText(textRepresentation);       
                            iv.setTextColor(Color.RED);                              
                            return true;                           
                    }        
                  return false;
            }           
}
</code></pre>

<p>here I want to ask how to? this images.as an reference</p>

<p><img src="http://i.stack.imgur.com/him0o.jpg" alt="enter image description here"></p>
