Most visited

Recently visited

Added in API level 11

ActionMode.Callback

public static interface ActionMode.Callback

android.view.ActionMode.Callback
Known Indirect Subclasses


操作模式的回调界面。 提供给startActionMode(Callback) ,回调配置并处理用户与动作模式交互引发的事件。

行动模式的生命周期如下:

Summary

Public methods

abstract boolean onActionItemClicked(ActionMode mode, MenuItem item)

打电话报告用户点击一个操作按钮。

abstract boolean onCreateActionMode(ActionMode mode, Menu menu)

第一次创建动作模式时调用。

abstract void onDestroyActionMode(ActionMode mode)

当行动模式即将退出并被销毁时调用。

abstract boolean onPrepareActionMode(ActionMode mode, Menu menu)

被调用以在操作模式失效时刷新操作模式的操作菜单。

Public methods

onActionItemClicked

Added in API level 11
boolean onActionItemClicked (ActionMode mode, 
                MenuItem item)

打电话报告用户点击一个操作按钮。

Parameters
mode ActionMode: The current ActionMode
item MenuItem: The item that was clicked
Returns
boolean true if this callback handled the event, false if the standard MenuItem invocation should continue.

onCreateActionMode

Added in API level 11
boolean onCreateActionMode (ActionMode mode, 
                Menu menu)

第一次创建动作模式时调用。 所提供的菜单将用于生成操作模式的操作按钮。

Parameters
mode ActionMode: ActionMode being created
menu Menu: Menu used to populate action buttons
Returns
boolean true if the action mode should be created, false if entering this mode should be aborted.

onDestroyActionMode

Added in API level 11
void onDestroyActionMode (ActionMode mode)

当行动模式即将退出并被销毁时调用。

Parameters
mode ActionMode: The current ActionMode being destroyed

onPrepareActionMode

Added in API level 11
boolean onPrepareActionMode (ActionMode mode, 
                Menu menu)

被调用以在操作模式失效时刷新操作模式的操作菜单。

Parameters
mode ActionMode: ActionMode being prepared
menu Menu: Menu used to populate action buttons
Returns
boolean true if the menu or action mode was updated, false otherwise.

Hooray!