Hi Mike,
First of all, thanks for your amazing job!
I am trying to use the method drawer.updateIcon(id, image in bitmap)
.
But the image don't update. I checked the image and is correct.
I tried update using the header object, but not work too.
There is any library that is necessary for this to work?
I can't find a solution.
Thanks again.
@GutoMartins019 you had an image prior to setting the bitmap?
And your item has an identifier set?
@mikepenz
Yes, i had a image before update, it was setted on create. My item have a identifier, a int value.
This is how i made:
new ProfileDrawerItem()
.withName(user.getFirstName())
.withEmail(user.getEmail())
.withIcon(user.getProfileImageInBitmap())
.withIdentifier(3)
Added this ProfileDrawerItem to my AccountHeaderBuilder
Build my drawer on create activity:
drawer = new DrawerBuilder().withAccountHeader(headerResult)
And now i want to update the profile imagem like this:
if (drawer != null) {
User user = new UserService().getUser();
drawer.updateIcon(3, new ImageHolder(user.getProfileImageInBitmap()));
}
@GutoMartins019 you are mixing drawer and header.
If you want to update a profile (an item of the AccountHeader
) you have to use the AccountHeader
specific methods to update it's elements.
Which would result in something like this, to update the icon:
profile5.withIcon(BitmapFactory.decodeResource(getResources(), R.drawable.leak_canary_icon));
headerResult.updateProfile(profile5);
@mikepenz Thanks for help me!
Sorry for mixing things =/.
Now its working perfect!
Most helpful comment
@GutoMartins019 you are mixing drawer and header.
If you want to update a profile (an item of the
AccountHeader
) you have to use theAccountHeader
specific methods to update it's elements.Which would result in something like this, to update the icon: