Hello im trying to show image in an ImageView, from the data that i stored in database, but the image was not shown. I dont know what's wrong in my code. I have tried using Glide and Picasso, but it shows error like this. Please help, is it because of the size of image that i stored, or what.. If it is because of the size, then what should i do to make it show? Thank you.
java:
String simage_event = jsonArray.getJSONObject(0).getString("image_event"); //this is how i get the image_event's data
xml:
<ImageView
android:id="@+id/img_det_event"
android:layout_width="350dp"
android:layout_height="350dp"
android:src="@drawable/ic_event"/>
Glide code:
Glide.with(EoDetTambahEventActivity.this)
.load(simage_event)
.placeholder(R.drawable.ic_event)
.into(img_det_event);
Picasso code:
Picasso.get().load(simage_event).into(img_det_event);
Error with Picasso:
E/NetworkUtilities: [MTK_net]ss.ss_family:10
[MTK_net]ss.ss_family:2
[MTK_net]ss.ss_family:2
[MTK_net]ss.ss_family:2
E/NetworkUtilities: [MTK_net]ss.ss_family:2
Error with Glide:
E/NetworkUtilities: [MTK_net]ss.ss_family:10
[MTK_net]ss.ss_family:2
[MTK_net]ss.ss_family:2
[MTK_net]ss.ss_family:2
E/NetworkUtilities: [MTK_net]ss.ss_family:2
E/NetworkUtilities: [MTK_net]ss.ss_family:2
[MTK_net]ss.ss_family:2
W/Glide: Load failed for http://192.168.x.x/image_event/y9qd21z0e1biqjia7tun.png with size [1050x1050]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
There was 1 cause:
java.io.FileNotFoundException(http://192.168.x.x/image_event/y9qd21z0e1biqjia7tun.png)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, REMOTE
There was 1 cause:
java.io.FileNotFoundException(http://192.168.x.x/image_event/y9qd21z0e1biqjia7tun.png)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed
There was 1 cause:
java.io.FileNotFoundException(http://192.168.x.x/image_event/y9qd21z0e1biqjia7tun.png)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class java.io.FileNotFoundException: http://192.168.x.x/image_event/y9qd21z0e1biqjia7tun.png
I/Glide: Root cause (1 of 1)
java.io.FileNotFoundException: http://192.168.x.x/image_event/y9qd21z0e1biqjia7tun.png
Build.gradle:
repositories {
mavenCentral()
google()
}
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'com.squareup.picasso:picasso:2.71828'
question from:
https://stackoverflow.com/questions/65906041/can-not-showing-image-from-database-with-glide-or-picasso 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…