I'm using Picasso to load images from URLs into ImageViews. The problem is that all images are being displayed in landscape. The thing is that if the image is in landscape it needs to be displayed in landscape and if the image is in portrait it need to be displayed in portrait. If I use .rotate(90), the images that are correctly in the landscape mode will be rotated too.
ImageView image = new ImageView(getActivity());
Picasso.with(getActivity())
.load(details.getUrl())
.into(image);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
params.gravity = Gravity.CENTER;
image.setLayoutParams(params);
ll.addView(image);