I am facing problem about loading a online image into Glide: I have tried those code:
My build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.devX.meta"
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:cardview-v7:27.0.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:27.0.0'
// implementation 'com.android.support.constraint:constraint-layout:1.1.3'
compile 'com.github.bumptech.glide:glide:3.8.0'
}
NB: I can't Change my API Level
Without Changing Api Level of gradle how to solve this?
This is the Glide Code Which I am calling From
MainActivity
Glide.with(this).load("https://animevaya.000webhostapp.com/wp-content/uploads/2020/05/ic_launcher-web.png").placeholder(R.drawable.window).error(R.drawable.bg_white_text_red).into(ImgX);
Have any Solution?
You can try with latest version
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
Then
RequestManager requestManager = Glide.with(this);
RequestBuilder requestBuilder = requestManager.load("your_url");
requestBuilder.into(imageViewOBJ);
compile
. Move to implementation
.AndroidX
.compileSdkVersion
should be 29.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.