Android – setting size of grid view items according to screensize

While working in an android project, I came across a situation where the grid item’s size was differing with screensize. This is my gridview <GridView android:id=”@+id/PhoneImageGrid” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:columnWidth=”90dp” android:gravity=”center” android:horizontalSpacing=”10dp” android:numColumns=”auto_fit” android:stretchMode=”columnWidth” android:verticalSpacing=”10dp” />   Obvious because, in my gridview’s adapter, I had set the dimensions as 150 * 150 px.  imageView.setLayoutParams(new GridView.LayoutParams(150,150)); //dimension […]