Multi selection in listview
<p>I have create simple multi selection list view using array adapter. i wanna set background color particular list item. But suppose i select 2 item mean set background and also set 12th position and 22 position like wise selected automatically. please suggest me problem.</p>

<blockquote>
  <p>Code Black.</p>
</blockquote>

<pre><code>public class MainActivity extends Activity {

ListView lvCountry;

ArrayList&lt;Integer&gt; list = new ArrayList&lt;Integer&gt;();
String[] country = { "India", "USA", "Russsia", "China", "Pakistan",
        "Canada", "UK", "arcot", "vellore", "gudiyattam", "arani",
        "palani", "chennai", "padi", "velacherry", "ambattur",
        "ambatttur ot", "maduravoyal", "guindy" };

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    lvCountry = (ListView) findViewById(R.id.listView1);
    // Array adapter
    ArrayAdapter&lt;String&gt; arrayAdapter = new ArrayAdapter&lt;String&gt;(
            MainActivity.this, android.R.layout.simple_list_item_1, country);
    lvCountry.setAdapter(arrayAdapter);

    // list selection part
    lvCountry.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1,
                int position, long arg3) {
            // color selection select item
            arg1.setBackgroundColor(Color.GRAY);
        }
    });
}}
</code></pre>