Questions about Android ring letter not getting the nickname correctly

Source: Internet
Author: User
Tags sqlite database

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.