Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetAvatar Not working in contacts api #1

Open
gibrangul opened this issue Jul 11, 2014 · 0 comments
Open

GetAvatar Not working in contacts api #1

gibrangul opened this issue Jul 11, 2014 · 0 comments

Comments

@gibrangul
Copy link

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;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant