Basic Android tutorial _ sharing Function

Source: Internet
Author: User

The sharing functions in the Android program are divided into third-party program sharing, that is, using QQ space, QQ Weibo, Sina Weibo, Renren and other third-party packages for sharing;
There is also the use of local programs to share, such as text messages, UC browsers, Bluetooth, etc. The difference is that the use of third-party packages to share the mobile phone system does not need to install such programs, while the local program
Sequence sharing is required. Here we mainly talk about using local programs for sharing. The effect is shown in:


The implementation code is as follows;
[Java]
Intent email = new Intent (android. content. Intent. ACTION_SEND );
Email. setType ("text/plain ");
// Set the default email address
// Email. putExtra (android. content. Intent. EXTRA_EMAIL, "1 ");
// Set the default email title
Email. putExtra (android. content. Intent. EXTRA_SUBJECT,
"I am the mail title ");
// Set the content to be sent by default
Email. putExtra (android. content. Intent. EXTRA_TEXT,
"I am sharing content ");
// Call the system's email system
Activity. startActivity (Intent. createChooser (email, "Sharing Method "));


Author: johnny901114

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.