title: After tapping programmatically the row doesnt got highlighted in listview android
body: <p>I have a list view which i have populated and after populating it i have made a click programmatically which make my listview onItemclick event to be executed. Till here its fine but my problem is i cant able to highlight the row which is programmatically clicked i have set the background color to be changed on click event here i am putting my code</p>
  
  <pre><code>messageListView.setOnItemClickListener(new OnItemClickListener() {
  
              @Override
              public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,
                      long arg3) {
                  try {
  //                  arg1.setSelected(true);
                      lastSelectedView1.setBackgroundColor(HomeActivity.this
                              .getResources().getColor(R.color.white));
                      lastSelectedView2.setBackgroundColor(HomeActivity.this
                              .getResources().getColor(R.color.white));
                      lastSelectedTextView1.setTextColor(HomeActivity.this
                              .getResources().getColor(R.color.dark_gray));
                      lastSelectedTextView2.setTextColor(HomeActivity.this
                              .getResources().getColor(R.color.dark_gray));
                      lastSelectedTextView3.setTextColor(HomeActivity.this
                              .getResources().getColor(R.color.dark_gray));
                      lastSelectedView.setBackgroundColor(HomeActivity.this
                              .getResources().getColor(R.color.white));
                      lastFriendNameTextView.setTextColor(HomeActivity.this
                              .getResources().getColor(R.color.dark_gray));
                      lastSentMessageLabelTextView.setTextColor(HomeActivity.this
                              .getResources().getColor(R.color.dark_gray));
                      lastSentMessageTextView.setTextColor(HomeActivity.this
                              .getResources().getColor(R.color.dark_gray));
                      lastReceivedMessageLabelTextView
                              .setTextColor(HomeActivity.this.getResources()
                                      .getColor(R.color.dark_gray));
                      lastReceivedMessageTextView.setTextColor(HomeActivity.this
                              .getResources().getColor(R.color.dark_gray));
                      lastPhoneNumberTextView.setTextColor(HomeActivity.this
                              .getResources().getColor(R.color.dark_gray));
                  } catch (Exception e) {
                      System.out.println("&gt;&gt;&gt;Exception&gt;&gt;&gt;" + e.toString()
                              + "&gt;&gt;&gt;Message&gt;&gt;&gt;" + e.getMessage());
                  }
  
                  try {
                      View view1 = arg1.findViewById(R.id.top_layout);
                      View view2 = arg1.findViewById(R.id.row_background);
                      TextView textView1 = (TextView) arg1
                              .findViewById(R.id.textView1);
                      textView1.setTextColor(HomeActivity.this.getResources()
                              .getColor(R.color.white));
                      TextView textView2 = (TextView) arg1
                              .findViewById(R.id.textView2);
                      textView2.setTextColor(HomeActivity.this.getResources()
                              .getColor(R.color.white));
                      TextView timeTextView = (TextView) arg1
                              .findViewById(R.id.time_textview);
                      timeTextView.setTextColor(HomeActivity.this.getResources()
                              .getColor(R.color.white));
                      view1.setBackgroundColor(HomeActivity.this.getResources()
                              .getColor(R.color.dark_gray));
                      view2.setBackgroundColor(HomeActivity.this.getResources()
                              .getColor(R.color.dark_gray));
                      lastSelectedView1 = view1;
                      lastSelectedView2 = view2;
                      lastSelectedTextView1 = textView1;
                      lastSelectedTextView2 = textView2;
                      lastSelectedTextView3 = timeTextView;
                      isSelectedFromMessageList = true;
                      selectedItemFromMessageList = messageArrayList.get(arg2).Name;
                      selectedContactItem = arg2;
                      // createMessageLayout(selectedItemFromMessageList);
  
                      // setListButtonBackground();
                      createMessageLayout(messageArrayList.get(arg2).Name);
                  } catch (Exception e) {
                      System.out.println("&gt;&gt;&gt;Exception&gt;&gt;&gt;" + e.toString()
                              + "&gt;&gt;&gt;Message&gt;&gt;&gt;" + e.getMessage());
                  }
              }
          });
  </code></pre>
  
  <p>Whats wrong with my code???</p>