Example usage for android.widget TextView setCustomSelectionActionModeCallback

List of usage examples for android.widget TextView setCustomSelectionActionModeCallback

Introduction

In this page you can find the example usage for android.widget TextView setCustomSelectionActionModeCallback.

Prototype

public void setCustomSelectionActionModeCallback(ActionMode.Callback actionModeCallback) 

Source Link

Document

If provided, this ActionMode.Callback will be used to create the ActionMode when text selection is initiated in this View.

Usage

From source file:org.chaos.fx.cnbeta.details.DetailsFragment.java

@Override
public void addTextToContent(String text) {
    TextView view = (TextView) getActivity().getLayoutInflater().inflate(R.layout.article_content_text_item,
            mContentLayout, false);//from ww w .jav a  2s.  c o  m
    mContentLayout.addView(view);
    scaleTextSize(view, mTextRelativeSize);
    view.setText(text);
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
        view.setCustomSelectionActionModeCallback(mSelectedActionCallback);
    }
    // TODO: 18/05/2017 ??
    //        Linkify.addLinks(view, Linkify.WEB_URLS);
}