简体   繁体   中英

Override methods in contextual action bar

在android文本视图中选择文本时,上下文操作栏会提供复制,剪切,全选,共享等选项。是否可以捕获这些选项的onClicks并覆盖它们?

Try creating your own custom ActionMode.Callback for the text view. In the ActionMode.Callback you can create your own menu in which you can remove/change the options. You can also control the behavior with a

@Override
    public boolean onActionItemClicked(ActionMode mode, MenuItem item) {}

method override. see http://developer.android.com/guide/topics/ui/menus.html#CAB and Contextual Action Bar text selection for more information. Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM