Materialdrawer: problem with update name and email of current profile

Created on 30 Sep 2016  路  2Comments  路  Source: mikepenz/MaterialDrawer

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.

question

Most helpful comment

Just use the withIdentifier method

All 2 comments

@bkhezry your item needs an identifier so it can be updated.

Just use the withIdentifier method

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jd-alexander picture jd-alexander  路  4Comments

HanderWei picture HanderWei  路  3Comments

Meeks91 picture Meeks91  路  3Comments

wayne1203 picture wayne1203  路  3Comments

fuentepa picture fuentepa  路  3Comments