this is my code to put some image doodads in my GridView
public View getView(int position, View convertView, ViewGroup parent) {
ImageView v;
if(convertView == null) {
v = new ImageView(c);
v.setLayoutParams(new GridView.LayoutParams(90,90));
v.setScaleType(ImageView.ScaleType.CENTER_CROP);
v.setPadding(2, 2, 2, 2);
} else {
v = (ImageView) convertView;
}
v.setImageDrawable(c.getResources().getDrawable(ops[position]));
return v;
}
but for smaller machines the layoutParams are too big, does anyone know how i can do like a (90dp, 90dp) for the width and height on the java side?