如何调用动作条的文本菜单样的行为?菜单、文本、行为、动作

2023-09-12 09:16:14 作者:念欢

在的Andr​​oid 3.0,当您选择一些文本例如,动作条切换到文本菜单式的模式,使你做的动作与所选文本:复印/股的/ etc,和一个完成按钮出现在左侧,以使用户离开这个模式

In Android 3.0, when you select some text for example, the ActionBar switches to a ContextMenu-like mode, which enables you to do actions with the selected text: copy/share/etc, and a "Done" button appears on the left side to enable the user to leave this mode.

我如何切换动作条到这个模式在我的应用程序(我的菜单,当然项)?我只是找不到此的文档。

How can I switch the ActionBar into this mode in my app (with my menu items of course)? I just couldn't find this in the docs.

推荐答案

是啊,我找不到它要么 - 我不得不问,在谷歌I |。0

Yeah, I couldn't find it either -- I had to ask at Google I|O.

使用startActionMode(). Here是他们的样品演示它之一。我需要做更多的工作,在这方面我自己。

Use startActionMode(). Here is one of their samples that demonstrates it. I need to do more work in this area myself.