共用方式為


Intent.CategoryAlternative Field

Definition

Set if the activity should be considered as an alternative action to the data the user is currently viewing.

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

Field Value

Implements

Attributes

Remarks

Set if the activity should be considered as an alternative action to the data the user is currently viewing. See also #CATEGORY_SELECTED_ALTERNATIVE for an alternative action that applies to the selection in a list of items.

Supporting this category means that you would like your activity to be displayed in the set of alternative things the user can do, usually as part of the current activity's options menu. You will usually want to include a specific label in the &lt;intent-filter&gt; of this action describing to the user what it does.

The action of IntentFilter with this category is important in that it describes the specific action the target will perform. This generally should not be a generic action (such as #ACTION_VIEW, but rather a specific name such as "com.android.camera.action.CROP. Only one alternative of any particular action will be shown to the user, so using a specific action like this makes sure that your alternative will be displayed while also allowing other applications to provide their own overrides of that particular action.

Java documentation for android.content.Intent.CATEGORY_ALTERNATIVE.

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