bumptech / bumptech/glide

[New Feature] Image can't show in Fragment

Open
#4,670 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
35k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
8

Description

**Glide Version**:4.12.0 and also 4.8.0

**Integration libraries**:AndroidAutoSize、com.tencent.tbs、androidx.***、com.google.android.material:material

**Device/Android Version**: XiaoMi 10 Ultra with Android 11

**Issue details / Repro steps / Use case background**:
With the same glide code, the imageview can show image in Activity, but will show nothing in Fragment in **ViewPager2** in the same project.

**Glide load line / `GlideModule` (if any) / list Adapter code (if any)**:
```kotlin
implementation 'com.github.bumptech.glide:glide:4.12.0'
kapt 'com.github.bumptech.glide:compiler:4.12.0'.

@GlideModule
class CMAppGlideModule : AppGlideModule() {
override fun applyOptions(context: Context, builder: GlideBuilder) {
builder.setLogLevel(Log.VERBOSE);
}
}

class PersonalFragment : Fragment() {
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
Glide.with(this).load(R.mipmap.default_avatar).into(binding.ivPersonalAvatar)
}
}
```

**Layout XML**:
```xml

```

**Stack trace / LogCat**:
```ruby
2021-10-20 18:26:42.420 5881-5881/com.trusfort.chemistrytool D/Glide: Finished loading BitmapDrawable from RESOURCE_DISK_CACHE for 2131558401 with size [161x161] in 62.561875 ms
```

I have also tried ```override(int, int)``` and ```asBitmap()``` which still no worked

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.