title: listview item background color change
body: <p>I am working on an android application. I have created a listview by using </p>
  
  <pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,arrayname));   
  getListView().setTextFilterEnabled(true);   
  </code></pre>
  
  <p>Now i want to change the selected item's color. I could change the background of the selected item by placing</p>
  
  <pre><code>listviewobject.getChildAt(position).setBackgroundColor(Color.BLACK);
  </code></pre>
  
  <p>in onListItemClick()</p>
  
  <p>this code is changing the background color but if I select any other list item then also the previously clicked list item's color is red.So I change the previously clicked listitem's color by</p>
  
  <pre><code>l.getChildAt(prevpos).setBackgroundColor(Color.BLACK);
  </code></pre>
  
  <p>now the problem is if i change the background of previously clicked listitems color to black.Then i can't see the text on that particular listitem.I i click again then only i can see the text on that item.So its look weired.please help me friends</p>