Change ListView icon depends on a value [Solved]
<p>i wonder how can i change a listview icon depend on a value came from the XML file i pulled to fill the list</p>

<p>something like this :::</p>

<p>i tried to make an if clause but it didn't work i don't know why :( </p>

<pre><code>super.onCreate(savedInstanceState);
    setContentView(R.layout.lisplaceholder);
    Utilites temp = new Utilites();
    ArrayList&lt;HashMap&lt;String, String&gt;&gt; mylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
    String xml = XMLfunctions.getXML("http://www.akwad-arabia.com/android/test.php?user=1&amp;format=xml");
    Document doc = XMLfunctions.XMLfromString(xml);                
    int numResults = XMLfunctions.numResults(doc);

    /*if((numResults &lt;= 0)){
        Toast.makeText(this, "Geen resultaten gevonden", Toast.LENGTH_LONG).show();  
        finish();
    }*/

    NodeList nodes = doc.getElementsByTagName("record");

    for (int i = 0; i &lt; nodes.getLength(); i++) 
    {                           
        HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();            
        Element e = (Element)nodes.item(i);
        map.put("id", XMLfunctions.getValue(e, "id"));
        //map.put("name", XMLfunctions.getValue(e, "name"));
        //if (XMLfunctions.getValue(e, "id") == "22")
            map.put("name", XMLfunctions.getValue(e, "name"));
        //else
        //  map.put("name", "asdasd");
        mylist.add(map);
        //this. list.add(country);
    }
    ListAdapter adapter = new SimpleAdapter(this, mylist , R.layout.main, 
            new String[] { "name" }, 
            new int[] { R.id.item_name});

    setListAdapter(adapter);
</code></pre>
