Silicon Valley social 11 -- the session List page on the homepage, and 11 -- the homepage

Source: Internet
Author: User

Silicon Valley social 11 -- the session List page on the homepage, and 11 -- the homepage

1) inherit EaseConversationListFragment
2) Listening events for adding contact messages

// Listen for changes to the EMClient session. getInstance (). chatManager (). addMessageListener (emMessageListener); private EMMessageListener emMessageListener = new EMMessageListener () {@ Override public void listener (List <EMMessage> list) {// set EaseUI. getInstance (). getNotifier (). onNewMesg (list); // refresh List refresh () ;}@ Override public void onreceivmessagereceived (list <EMMessage> List) {}@ Override public void onMessageReadAckReceived (list <EMMessage> list) {}@ Override public void onMessageDeliveryAckReceived (List <EMMessage> list) {}@ Override public void onMessageChanged (EMMessage emMessage, Object o ){}};

 

3) Click events of session entries

// Listen to the setConversationListItemClickListener (new EaseConversationListItemClickListener () {@ Override public void onListItemClicked (EMConversation conversation) {Intent intent = new Intent (getActivity (), ChatActivity. class); // The intent parameter. putExtra (EaseConstant. EXTRA_USER_ID, conversation. conversationId (); // the current session type is group chat if (conversation. getType () = EMConversation. EMConversationType. groupChat) {intent. putExtra (EaseConstant. EXTRA_CHAT_TYPE, EaseConstant. CHATTYPE_GROUP);} getActivity (). startActivity (intent) ;}}); // clears the current session List data and prepares to load new data conversationList. clear ();

  

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.