little problem, I would like to display an image from an url, without using (glide, picasso etc ...), I want to learn from the errors I make, here is my code, the activity stops , do you see something that I missed?
onCreate :
String imgUrl = "https://st3.depositphotos.com/1008939/12603/i/950/depositphotos_126032722-stock-photo-roaring-singing-woman.jpg";
ImageView img = findViewById(R.id.imageArtist);
try {
InputStream input = new java.net.URL(imgUrl).openStream();
Bitmap bitmap = BitmapFactory.decodeStream(input);
img.setImageBitmap(bitmap);
} catch (IOException e) {
e.printStackTrace();
}
xml :
<ImageView
android:layout_width="@dimen/dim_170"
android:layout_height="@dimen/dim_170"
android:id="@+id/imageArtist"
android:layout_below="@+id/txtViewTitleArtist"
android:layout_centerInParent="true"
android:layout_margin="@dimen/dim_15"
tools:ignore="ContentDescription" />
thx for your help