简体   繁体   中英

How to select the text in EditText and provide tooltip for the Rich Text Editing in Android

How can we select a part of the text in EditText. And after selecting that part of the text, how can we provide a tooltip to make that text rich, ie providing different toggle button kind of things in the tooltip to change the fontstyle, color, bold, italics etc.

private class CustomTextWatcher implements TextWatcher 
{
    private EditText myEditText;

    public CustomTextWatcher(EditText e) 
    {
        myEditText = e;
    }

    public void beforeTextChanged(CharSequence s, int start, int count,int after) 
    {

    }

    public void onTextChanged(CharSequence s, int start, int before,
            int count) {
        //do the stuff you want to do here.
    }

    @Override
    public void afterTextChanged(Editable arg0) {

    }
}

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