title: Get the Text of clicked item in gridView
body: <p>I have a gridView in which every cell contains an ImageView and a TextView. When the user clicks on an item, I want to take the text of TextView in position which the user clicked. I tried the code below, but every time I take the first element.</p>
  
  <pre><code>grid.setOnItemClickListener(new AdapterView.OnItemClickListener() {
       public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {
  
          ViewGroup gridChild = (ViewGroup) grid.getChildAt(position);
          int childSize = gridChild.getChildCount();
  
          for(int k = 0; k &lt; childSize; k++) {
             if(gridChild.getChildAt(k) instanceof TextView ){
                    TextView temp = (TextView) findViewById(gridChild.getChildAt(k).getId());
                    stationId = temp.getText().toString();
                    Log.i("stationId", stationId);
              }
          }
  </code></pre>