AnsweredAssumed Answered

Smack 4.1.7 调用RosterEntry setName(..)设置成功后,执行RosterEntry.getName获取到的值还是原来老的值

Question asked by Tony on Jul 13, 2016

step 1.

     RosterEntry rosterEntry = mRoster.getEntry(userJid);

     rosterEntry.setName("new Name");

     //设置成功

 

step 2.

     Collection<RosterEntry> unFiledRosterEntries = mRoster.getUnfiledEntries();

     for (RosterEntry entry : unFiledRosterEntries) {

          entry.getName(); // 这里获取到的Name永远是setName之前的Name

     }

 

-------------------------------------------------------------------------------- ------------------------

 

after rosterEntry.setName("new Name") success, then perform mRoster.reload() get the same result as before

Outcomes