title: How to highlight row in ListView in Android?
body: <p>I need to highlight a row in a <code>ListView</code> that was selected (to show the user what he chose), so, it's not the one that is going to be chosen, it's the one he chose before.</p>
  
  <p>I already have the location by:</p>
  
  <pre><code>ListView.setSelection(position);
  </code></pre>
  
  <p>And now what I want is to select this specific row and to highlight it.</p>
  
  <p>The code of the <code>onCreate()</code> in the activity that contains the <code>ListView</code>:</p>
  
  <pre><code>public class CountryView extends Activity
  {
      protected static final String LOG_TAG = null;
      /** Called when the activity is first created. */
      String[] lv_arr = {};
  
      ListAdapter adapter;
      TextView t;
      private ListView lvUsers;
      private ArrayList&lt;Coun&gt; mListUsers;
      String responce=null;
      public int d;
      int selectedListItem = -1;
  
  
      @Override
      public void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.country);
  
          Intent data =getIntent();
  
          mListUsers = getCoun();
          lvUsers = (ListView) findViewById(R.id.counlistView);
  
  
          lvUsers.setAdapter(new ListAdapter(this, R.id.counlistView, mListUsers)); 
  
  
          selectedListItem=data.getExtras().getInt("PositionInList");
  
         lvUsers.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
  
  
  
          lvUsers.setOnItemClickListener(new OnItemClickListener()
          {
  
              int positionItem;
  
              public void onItemClick(AdapterView&lt;?&gt; parent, View view,int position, long id)
              {
                  Intent pongIntent = new Intent(getApplicationContext(),Trav.class);
  
                  int counId=mListUsers.get(position).id;
  
                  pongIntent.putExtra("response",mListUsers.get(position).p);
                  pongIntent.putExtra("responseCounID",counId);
  
                  //Put the position of the choose list inside extra
                  positionItem=position;
                  pongIntent.putExtra("PositionInListSet",positionItem);
  
                  setResult(Activity.RESULT_OK,pongIntent);
  
                  Log.i("CounID *******************************"," "+counId);
                  finish();
              }
           });
      }
  }
  </code></pre>