I have an ImageView and I want this to be resized automatically. I mean, no matter the size of the image this myst be displayed with the same size but, this also must work for different screen sizes so I can not assign a specific value. This is the xml:
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="30"
android:layout_gravity="center"
/>
and this the code
imageFoto=(ImageView)v.findViewById(R.id.image);
url = new URL("http://54.76.186.59/Foto/Foto.jpg");
bmp = BitmapFactory.decodeStream(url.openConnection().getInputStream());
imageFoto.setImageBitmap(bmp);
imageFoto.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
imageFoto.setAdjustViewBounds(true);