title: Android gridview row height according to the display
body: <p>and sorry for my english.
  A simple question (if you know the answer :-D):
  I have a GridView with only images, all the images are same size. I have set the numbers of colums in xml. Here is the code:</p>
  
  <pre><code>&lt;GridView xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/grid_view_bambini14"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:numColumns="@integer/grid_columns" &lt;!-- grid_colums value is set in res/values, in case the display is landscape or portrait--&gt;
          android:horizontalSpacing="10sp"
          android:verticalSpacing="10sp"
          android:gravity="center"
          android:stretchMode="columnWidth" &gt;
  </code></pre>
  
  <p>And this is the java code:</p>
  
  <pre><code>Public View getView(int position, View convertView, ViewGroup parent) {
      ImageView imageView;
      if (convertView == null) {
          imageView = new ImageView(mContext);
          imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
          imageView.setLayoutParams(new GridView.LayoutParams(GridView.AUTO_FIT , 260));
      } else {
          imageView = (ImageView) convertView;
      }
      imageView.setImageResource(mThumbIds[position]);
      return imageView;
  }
  </code></pre>
  
  <p>the problem is the row height. In some smartphone the images are show in the right way, in other (I suppose according to resolution and density of the monitor) the row are too high.
  I tried to change this row</p>
  
  <pre><code>imageView.setLayoutParams(new GridView.LayoutParams(GridView.AUTO_FIT , 260));
  </code></pre>
  
  <p>with different values instead of 260, ando so to put GridView.AUTO_FIT, but the result is always obscene.
  How can I fix it?
  Thanks!</p>