I have simple ImageView in XML:
<ImageView
android:id="@+id/imgItemFavorites"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/foo"
android:src="@drawable/vote_favorite" />
Now, if I reference that view in code and do:
ImageView img = (ImageView) llGenericList.findViewById(R.id.imgItemFavorites);
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.vote_favorite, null);
img.setImageBitmap(bitmap);
My ImageView ends up being smaller since loaded image is smaller. I presume this has something to do with autoscaling that's done because of tvdpi of Nexus 7, but can anyone give me idea how I can fix this in a robus way that won't screw up things on other devices?