I have a workaround.
There is a solution for WebView , but it does not work for XWalkView :
WebView Selection Bypass Menu
My gradle includes compile 'org.xwalk:xwalk_core_library:14.43.343.17'
My solution, the main idea of ββthe onAttachedToWindow method:
public class XWalkWebView extends XWalkView { public XWalkWebView(Context context, AttributeSet attrs) { super(context, attrs); } private ActionMode.Callback mOriginalCallback; @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); try { View innerChild = ((ViewGroup) getChildAt(0)).getChildAt(0); Field contentViewField = innerChild.getClass().getDeclaredField("mContentView"); contentViewField.setAccessible(true); XWalkContentView xWalkContentView = (XWalkContentView) contentViewField.get(innerChild); Field contentViewCoreField = xWalkContentView.getClass().getSuperclass().getDeclaredField("mContentViewCore"); contentViewCoreField.setAccessible(true); ContentViewCore viewCore = (ContentViewCore) contentViewCoreField.get(xWalkContentView); viewCore.setContainerView(this); } catch (NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); } } @Override public ActionMode startActionMode(ActionMode.Callback callback) { mOriginalCallback = callback; ActionMode.Callback c = new
source share