TextView getLinksClickable - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TextView getLinksClickable method.

This code example shows how to use the following methods:getLinksClickable, getText, setMovementMethod, setText
    private ListViewTool() { 
    } 
 
 
    public static void addLinks(TextView view) {
        CharSequence content = view.getText();
        view.setText(convertNormalStringToSpannableString(content.toString()));
        if (view.getLinksClickable()) {
            view.setMovementMethod(LongClickableLinkMovementMethod.getInstance());
        } 
    } 
 
    private static SpannableString convertNormalStringToSpannableString(String txt) {
        //hack to fix android imagespan bug,see http://stackoverflow.com/questions/3253148/imagespan-is-cut-off-incorrectly-aligned 
        //if string only contains emotion tags,add a empty char to the end 
        String hackTxt;
        if (txt.startsWith("[") && txt.endsWith("]")) {
            hackTxt = txt + " ";
        } else { 
            hackTxt = txt;
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related TextView getLinksClickable Questions & Answers:

getLinksClickable Method Overview
Returns whether the movement method will automatically be set to LinkMovementMethod if setAutoLinkMask(int) has been set to nonzero and links are detected in setText(char[], int, int).
See Code Examples for other Android TextView Methods: