title: Highlight selected item on a gridview
body: <p>I am trying to highlight a selected item on a gridview (dinamically populated with an adapter), but it is not working.</p>
  
  <p>I did research and i even tried to copy exactly the selector of other people and even the way that they put it on the gridview but i am not being able to put it working.</p>
  
  <p>It just doesn't do anything. The background of each item is white (like i wanted), but when i press it (it it is on top of a textview or a imageview (part of the gridview item) it doesn't do anything. If i press out of the imageView or textview, it will do what i want.</p>
  
  <p>EDIT : I have listeners for the images and the textviews, so it might be interfering with this selector ? How could i solve this problem? </p>
  
  <p>Here is the code of the activity where i create the gridview :</p>
  
  <pre><code>  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.highway_appselection_activity);
      gridView= (GridView) findViewById(R.id.HighwayGridView);
  
      gridView.setSelector(new ColorDrawable(Color.BLACK));
  </code></pre>
  
  <p>Here is the xml of each item of this gridview : (where i define the background as the selector)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:id="@+id/HighwayGridViewItem"
  android:orientation="vertical"
  android:background="@drawable/highway_appselection_selector"
  android:padding="5dp"&gt;
  
  &lt;cm.aptoide.lite.HighwayCustomImageView
      android:layout_width="72dp"
      android:layout_height="72dp"
      android:id="@+id/highwayGridViewItemIcon"
      android:background="#FFFFFF"
      android:layout_gravity="center"
      android:scaleType="centerCrop"
      android:padding="5dp"
      android:clickable="true"/&gt;
  
  &lt;!-- does this need to be my custom image view anymore? CHeck on that--&gt;
  &lt;LinearLayout
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:orientation="horizontal"&gt;
  
      &lt;TextView
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:id="@+id/highwayGridViewItemName"
         android:textColor="#000000"
         android:text="texto de teste"
         android:textSize="10sp"
          android:focusable="true"
         android:ellipsize="marquee"
         android:marqueeRepeatLimit="marquee_forever"
         android:layout_weight="2"
         android:textStyle="bold"
          android:paddingRight="5dp"
          android:layout_marginLeft="5dp"
          android:clickable="true"/&gt;
  
     &lt;ImageView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:src="@drawable/info_icon"
         android:padding="5dp"
         android:clickable="true"
         android:id="@+id/highwayGridViewItemInfoButton"/&gt;
  </code></pre>
  
  <p></p>
  
  <p></p>
  
  <p>And here is my selector :</p>
  
  <pre><code>  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"  android:exitFadeDuration="@android:integer/config_mediumAnimTime"&gt;
  &lt;item android:state_enabled="true" android:state_pressed="true" android:drawable="@color/green_main_color" /&gt;
  &lt;item android:state_enabled="true" android:state_focused="true" android:drawable="@color/green_main_color" /&gt;
  &lt;item android:state_enabled="true" android:state_selected="true" android:drawable="@color/green_main_color" /&gt;
  &lt;item android:drawable="@android:color/white" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>I might be missing something, I am new to Android, sorry if there is any rookie mistake.</p>