Android Question Remove image from cache in Amir_Glide library

Almora

Active Member
Licensed User
Longtime User
hi

I am using this code and AX_RecyclerView lib and Amir_Glide
I have a picture source that is renewed every day.
The picture from the application is not renewed every day. shows when I first installed the application. not showing the new picture the next day. not renewed. still showing the old picture. keeps pictures in memory. not renewed.
Is it possible to clear image from cache before getting newly replaced image? This will also solve the problem.
what can I do..

how can i apply it.

B4X:
Private Sub LoadImage (Img As ImageView,Position As Int)
    Dim Glide As Amir_Glide
    Dim color2 As ColorDrawable
    color2.Initialize(Colors.DarkGray,0)
    Glide.RequestManager.SetDefaultRequestOptions(Glide.RO.ErrorDrawable(color2).Placeholder(color2).CenterCrop)
    Glide.Initializer.Default
    End Sub
 

alimanam3386

Active Member
Licensed User
Longtime User
hi

I am using this code and AX_RecyclerView lib and Amir_Glide
I have a picture source that is renewed every day.
The picture from the application is not renewed every day. shows when I first installed the application. not showing the new picture the next day. not renewed. still showing the old picture. keeps pictures in memory. not renewed.
Is it possible to clear image from cache before getting newly replaced image? This will also solve the problem.
what can I do..

how can i apply it.

B4X:
    Activity.LoadLayout("1")
    ImageView1.Tag = Null
    Dim color2 As ColorDrawable
    color2.Initialize(Colors.Magenta,0)
    gl.Initializer.Default
    gl.RequestManager.ApplyDefaultRequestOptions(gl.RO.DiskCacheStrategy("NONE")) _
        .ApplyDefaultRequestOptions(gl.RO.SkipMemoryCache(True)) _
        .ApplyDefaultRequestOptions(gl.RO.ErrorDrawable(color2).Placeholder(color2).CenterCrop)
    gl.Load(photoAddress).Into(ImageView1)
 
Last edited:
Upvote 0
Top