We know that the system has a lot of action (action/activity) in Android, and by adding action information through intent, we can implement many system functions, such as opening albums, taking pictures, sending messages, etc. In the work, often use action_send this action, do a small summary, record down.
1, e-mail:
Uri uri= uri.parse ("Content://media/external/images/media/23");
Intent intent= New Intent (intent.action_send);
Intent.putextra ("Sms_body", "Shenrenkui");
Intent.putextra (Intent.extra_stream, URI);
Intent.settype ("Image/png");
StartActivity (Intent)
2, send mms:
Uri uri = uri.parse ("Content://media/external/images/media/23");
Intent Intent = new Intent (intent.action_send);
Intent . PutExtra ("Sms_body", "My Information");
Intent . PutExtra (Intent.extra_stream, URI);
Intent . SetType ("Image/png");
Next is the main feature of today, is to share the implementation of the function, we can realize the sharing function through the action_send, call up the mobile phone installed sharing software, and share our information out.
/** shared by intent*/
Intent Intent = new Intent (intent.action_send);
/** types of data shared */
Intent.settype ("Text/plain");
/** shared Theme (title) */
Intent.putextra (Intent.extra_subject, "friends sharing");
/** content */
Intent.putextra (Intent.extra_text, "I am using the fast code, you also join it!! ");
/** allows you to start a new activity */
Intent.setflags (Intent.flag_activity_new_task);
/** Target application Look for the title of the dialog box */
StartActivity (Intent.createchooser (Intent, "title"));
This will call the appropriate sharing app, such as SMS, e-mail, etc.
Action_send Small example of Android