Silicon Valley social networking 6 -- add Contacts -- send invitations to add friends, Silicon Valley 6 --

Source: Internet
Author: User

Silicon Valley social networking 6 -- add Contacts -- send invitations to add friends, Silicon Valley 6 --

1. Search button Processing

// Go to the server to determine whether the currently searched user has userInfo = new UserInfo (name); // update the UI to display runOnUiThread (new Runnable () {@ Overridepublic void run () {rl_add.setVisibility (View. VISIBLE); TV _add_name.setText (userInfo. getName ());}});

2. Add button Processing

Model.getinstance().getglobalthreadpool(cmd.exe cute (new Runnable () {@ Overridepublic void run () {// Add a friend try {EMClient to the email broker. getInstance (). contactManager (). addContact (userInfo. getName (), "add friend"); runOnUiThread (new Runnable () {@ Overridepublic void run () {Toast. makeText (AddContactActivity. this, "sent the invitation to add friends", Toast. LENGTH_SHORT ). show () ;}) ;}catch (final HyphenateException e) {e. printStackTrace (); runOnUiThread (new Runnable () {@ Overridepublic void run () {Toast. makeText (AddContactActivity. this, "failed to send an invitation to add friends" + e. toString (), Toast. LENGTH_SHORT ). show ();}});}}});

 

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.