As my image Uri uses a different way to make sure the App pivture is safe. It changes everytime when I request. For example, it may be like this
and next time it comes like this
As universal image loader uses the Uri as key for SD Chche .
The image Uri changes for the end of the Uri
I want to use only this part as key
I searched for a long time but still don`t get the answer.
So please help me
This issue is pretty simple to change. Nostra's universal image loader uses a interface "FileNameGenerator" with the method "generate" in com.nostra13.universalimageloader.cache.disc.naming; Just create or adapt a class there and use this for your purpose. E.g. change HashCodeFileNameGenerator to:
public class HashCodeFileNameGenerator implements FileNameGenerator {
@Override
public String generate(String imageUri) {
return String.valueOf(imageUri.substr(0, imageUri.indexOf("=")).hashCode());
}
}
The code above would generate a filename based on the image url till the first occurence of the sign '='.