1

java Code for load image fom URL

 ImageView img = (ImageView) findViewById(R.id.imageView); Glide.with(MainActivity.this) .load("https://yildirim.bel.tr/uploads/haberler/4509c5f0-7498- 4932-85d4-767e48408299image.jpeg") .into(img); 

manifest

<uses-permission android:name="com.googleandroid.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> 

Gradle

implementation 'com.github.bumptech.glide:glide:3.8.0' 
1
  • And I tried version 4.11.0 Commented Nov 5, 2020 at 11:46

2 Answers 2

1

First create a class like that:

import com.bumptech.glide.annotation.GlideModule; import com.bumptech.glide.module.AppGlideModule; // new since Glide v4 @GlideModule public final class MyAppGlideModule extends AppGlideModule { // leave empty for now } 

Then call the Glide as:

GlideApp.with(context) .load("https://yildirim.bel.tr/uploads/haberler/4509c5f0-7498- 4932-85d4-767e48408299image.jpeg") .override(300, 200) .into(img); 
Sign up to request clarification or add additional context in comments.

Comments

0

Try this

 RequestOptions options = new RequestOptions() .centerCrop() .placeholder(R.mipmap.ic_launcher_round) .error(R.mipmap.ic_launcher_round); Glide.with(this).load(image_url).apply(options).into(imageView); 

1 Comment

Thank you for your interest. but not loading my image. it is load android icon

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.