Я загружаю изображения в ImageView с URL. (из RSS-ленты)проблемы с разрешением загруженных изображений с url
Проблема в том, что разрешение загруженного изображения ниже исходного изображения!
Я искал Stackoverflow и обнаружил, что решение заключается в том, чтобы установить параметр «inScaled» равным false, чтобы предотвратить повторное масштабирование изображения. но это решение не сработало для меня.
Вот код:
URL feedImage= new URL(img_link);
HttpURLConnection conn= (HttpURLConnection)feedImage.openConnection();
InputStream is = conn.getInputStream();
BitmapFactory.Options BFoptions = new BitmapFactory.Options();
BFoptions.inScaled = false;
Bitmap img = BitmapFactory.decodeStream(is,null, BFoptions);
int density = img.getDensity(); Log.e("img", "Image density is " + density);
int width =img.getWidth(); Log.e("img", "Image width is " + width);
int height = img.getHeight(); Log.e("img", "Image height is " + height);
my_image.setImageBitmap(img);
Переменные плотности, ширины и высоты ниже значений исходного изображения.
и вот часть моего макета:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/joke_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="temp description"/>
<ScrollView
android:id="@+id/SV"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:background="@drawable/background"
android:paddingTop="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingBottom="50dp">
<!-- bla
bla
bla
-->
</ScrollView>
</RelativeLayout>
Заранее спасибо