次の方法で共有


ActionProvider.OnPerformDefaultAction Method

Definition

Performs an optional default action.

[Android.Runtime.Register("onPerformDefaultAction", "()Z", "GetOnPerformDefaultActionHandler")]
public virtual bool OnPerformDefaultAction ();
[<Android.Runtime.Register("onPerformDefaultAction", "()Z", "GetOnPerformDefaultActionHandler")>]
abstract member OnPerformDefaultAction : unit -> bool
override this.OnPerformDefaultAction : unit -> bool

Returns

Attributes

Remarks

Performs an optional default action.

For the case of an action provider placed in a menu item not shown as an action this method is invoked if previous callbacks for processing menu selection has handled the event.

A menu item selection is processed in the following order: <ul> <li> Receiving a call to MenuItem.OnMenuItemClickListener#onMenuItemClick MenuItem.OnMenuItemClickListener.onMenuItemClick. </li> <li> Receiving a call to android.app.Activity#onOptionsItemSelected(MenuItem) Activity.onOptionsItemSelected(MenuItem)</li> <li> Receiving a call to android.app.Fragment#onOptionsItemSelected(MenuItem) Fragment.onOptionsItemSelected(MenuItem)</li> <li> Launching the android.content.Intent set via MenuItem#setIntent(android.content.Intent) MenuItem.setIntent(android.content.Intent)</li> <li> Invoking this method. </li> </ul>

The default implementation does not perform any action and returns false.

Java documentation for android.view.ActionProvider.onPerformDefaultAction().

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