Hi,
I write this function for update current profile, but it didn't work.
when I execute this function email and password didn't change.
private void changeProfile(String name, String email) {
profile = new ProfileDrawerItem().withName(name).withEmail(email);
headerResult.updateProfile(profile);
}
I declare default profile and add it to headerResult with addProfiles function.
I try another method but it didn't work too.
private void changeProfile(String name, String email) {
headerResult.removeProfile(headerResult.getActiveProfile());
profile = new ProfileDrawerItem().withName(name).withEmail(email);
headerResult.addProfiles(profile);
}
I this method current profile didn't removed and size of profiles increase.
I want update name and email of current profile, how can I do it?
thanks.
@bkhezry your item needs an identifier so it can be updated.
Just use the withIdentifier method
Most helpful comment
Just use the
withIdentifiermethod