I want to put 8 image thumbs in one horizontal line, using the whole available width.
The images are retrieved from a webservice which lets me specify the dimensions.
I'd suggest using this:
widthPx = getWindowManager().getDefaultDisplay().getWidth();
Add the ImageView
s with a fixed size, i.e.:
thumbs.addView (iv, new LayoutParams(thumbSize, thumbSize));
To answer (partially) the questions in the comments:
The ImageView API says:
takes care of computing its measurement from the image so that it can be used in any layout manager
so it is probably assuming 60px for a 160 dpi (I may be wrong there).