共用方式為


Intent.ActionSend Field

Definition

Activity Action: Deliver some data to someone else.

[Android.Runtime.Register("ACTION_SEND")]
public const string ActionSend;
[<Android.Runtime.Register("ACTION_SEND")>]
val mutable ActionSend : string

Field Value

Implements

Attributes

Remarks

Activity Action: Deliver some data to someone else. Who the data is being delivered to is not specified; it is up to the receiver of this action to ask the user where the data should be sent.

When launching a SEND intent, you should usually wrap it in a chooser (through #createChooser), which will give the proper interface for the user to pick how to send your data and allow you to specify a prompt indicating what they are doing.

Input: #getType is the MIME type of the data being sent. get*Extra can have either a #EXTRA_TEXT or #EXTRA_STREAM field, containing the data to be sent. If using EXTRA_TEXT, the MIME type should be "text/plain"; otherwise it should be the MIME type of the data in EXTRA_STREAM. Use */* if the MIME type is unknown (this will only allow senders that can handle generic data streams). If using #EXTRA_TEXT, you can also optionally supply #EXTRA_HTML_TEXT for clients to retrieve your text with HTML formatting.

As of android.os.Build.VERSION_CODES#JELLY_BEAN, the data being sent can be supplied through #setClipData(ClipData). This allows you to use #FLAG_GRANT_READ_URI_PERMISSION when sharing content: URIs and other advanced features of ClipData. If using this approach, you still must supply the same data through the #EXTRA_TEXT or #EXTRA_STREAM fields described below for compatibility with old applications. If you don't set a ClipData, it will be copied there for you when calling Context#startActivity(Intent).

Starting from android.os.Build.VERSION_CODES#O, if #CATEGORY_TYPED_OPENABLE is passed, then the Uris passed in either #EXTRA_STREAM or via #setClipData(ClipData) may be openable only as asset typed files using ContentResolver#openTypedAssetFileDescriptor(Uri, String, Bundle).

Optional standard extras, which may be interpreted by some recipients as appropriate, are: #EXTRA_EMAIL, #EXTRA_CC, #EXTRA_BCC, #EXTRA_SUBJECT.

Output: nothing.

Java documentation for android.content.Intent.ACTION_SEND.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to