title: android TextView selected option
body: <p>Currently I am displaying two texts in the activity.
  e.g.: "Group 1" and "Group 2".</p>
  
  <p>I let user select the text (just like a button).</p>
  
  <p>I need to find out whether the above displayed text is selected or not and then change the background color.
  Here is the code I use for that. tv.isSelected() always evaluates to 'false'. Can any body tell me what I am doing wrong.
  Is the "isSelected()" method used for a different purpose than how I use it?</p>
  
  <pre><code>TextView textView = new TextView(this);     
  textView.setText("Group 1");
  
  textView.setOnClickListener(new View.OnClickListener() {
     @Override
     public void onClick(View view) {
      TextView tv = (TextView) view;
  
      if (tv.isSelected()) {
         tv.setBackgroundColor(Color.BLUE);                   
      } else {                
         tv.setBackgroundColor(Color.WHITE);
      }
  
     }
  });
  linearLayout.addView(textView);
  </code></pre>