In this case, username is recorded as a userid, and Nick is always empty ... , this is Getnick () is username .....
If you want to get your own system nickname then make the following adjustments, namely: Rewrite the Getnick and Setnick, which will save Nick to the local SQLite database
/*** Copyright (C) 2013-2014 easemob Technologies. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * You are not a use this file except in compliance with the License. * Obtain a copy of the License at *http://www.apache.org/licenses/LICENSE-2.0* Unless required by applicable law or agreed into writing, software * Distributed under the License is distributed On a "as is" BASIS, * without warranties or CONDITIONS of any KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ PackageCom.easemob.chatuidemo.domain;Importcom.easemob.chat.EMContact; Public classUserextendsEmcontact {Private intUnreadmsgcount; PrivateString Header; PrivateString Avatar; PrivateString Yxq_nick; PublicUser () {} PublicUser (String username) { This. Username =username; } PublicString GetHeader () {returnheader; } Public voidSetHeader (String header) { This. Header =header; } Public intGetunreadmsgcount () {returnUnreadmsgcount; } Public voidSetunreadmsgcount (intUnreadmsgcount) { This. Unreadmsgcount =Unreadmsgcount; } PublicString Getavatar () {returnAvatar; } Public voidSetavatar (String avatar) { This. Avatar =Avatar; } @Override Public inthashcode () {return17 *GetUserName (). Hashcode (); } @Override Public Booleanequals (Object o) {if(O = =NULL|| ! (OinstanceofUser)) { return false; } returngetusername (). Equals ((User) O). GetUserName ()); } @Override PublicString toString () {returnNick = =NULL?Username:nick; } @Override Public voidSetnick (String Nick) {//TODO auto-generated Method StubYxq_nick=Nick; } @Override PublicString Getnick () {//TODO auto-generated Method Stub//return Super.getnick (); returnYxq_nick = =NULL?Username:yxq_nick; }}
Questions about Android ring letter not getting the nickname correctly