How to override web view text selection menu in android

后端 未结 4 1890
有刺的猬
有刺的猬 2020-12-15 06:01

The basic android\'s web text selection menu is as shown in image attached below. It has options like copy, share, select all, web search.

I want to over ri

4条回答
  •  一向
    一向 (楼主)
    2020-12-15 06:18

    You need to overwrite action menus of activity

    more info you can read :https://developer.android.com/guide/topics/ui/menus.html

    HOW TO OVERWRITE:

    @Override
    public void onActionModeStarted(android.view.ActionMode mode) {
        mode.getMenu().clear();
        Menu menus = mode.getMenu();
        mode.getMenuInflater().inflate(R.menu.highlight,menus);
        super.onActionModeStarted(mode);
    }
    

    highlight

        
    
        
        
    
    

提交回复
热议问题