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