@HiltAndroidApp
class MelonFeedApp : Application() {
override fun onCreate() {
super.onCreate()
Glide.with(this)
.applyDefaultRequestOptions(RequestOptions().diskCacheStrategy(DiskCacheStrategy.ALL))
}
}
Here, I want that when the user has no internet then also his profile picture loads in the app from cache. For caching I'm using Glide but it doesn't work as expected. The image doesn't load when there's no internet. The image does load if there is internet.
Maybe the issue is that when there's no internet, the app tries to get the image from db, but it can't get it so the value of _profilePicUrl remains empty and so I get a warning
Load failed for [] with dimensions [468x468]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
THIS IS NOT AN ISSUE I JUST NEED SOME HELP
This is my UI
ViewModel
ApplicationClass
Here, I want that when the user has no internet then also his profile picture loads in the app from cache. For caching I'm using Glide but it doesn't work as expected. The image doesn't load when there's no internet. The image does load if there is internet.
Maybe the issue is that when there's no internet, the app tries to get the image from db, but it can't get it so the value of
_profilePicUrl
remains empty and so I get a warning