Skip to content

GetAvatar Not working in contacts api  #1

@gibrangul

Description

@gibrangul

Im trying to use the get avatar method but it returns the default value and not the image of the contact:

public Drawable getAvatar(final Context context, final Drawable defaultValue) {
Log.d(TAG, "getAvatar()");
if (this.mAvatar == null) {
if (this.mAvatarData != null) {
Bitmap b = BitmapFactory.decodeByteArray(this.mAvatarData, 0,
this.mAvatarData.length);
this.mAvatar = new BitmapDrawable(context.getResources(), b);
Log.d(TAG, "BitmapSet");
}
}
if (this.mAvatar == null) {
Log.d(TAG, "ImageNotAvailable");
return defaultValue;
}
return this.mAvatar;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions