TextView getMovementMethod - 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 getMovementMethod method.

This code example shows how to use the following methods:getMovementMethod, getText, setMovementMethod, setText
		void onClick(); 
	} 
 
	public static void clickify(TextView view, final String clickableText, final MyClickableSpan.OnClickListener listener) {
 
		CharSequence text = view.getText();
		String string = text.toString();
		MyClickableSpan span = new MyClickableSpan(listener);
 
		int start = string.indexOf(clickableText);
		int end = start + clickableText.length();
		if (start == -1)
			return; 
 
		if (text instanceof Spannable) {
			((Spannable) text).setSpan(span, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
		} else { 
			SpannableString s = SpannableString.valueOf(text);
			s.setSpan(span, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
			view.setText(s);

7
CodeRank

Related TextView getMovementMethod Questions & Answers:

getMovementMethod Method Overview
See Code Examples for other Android TextView Methods: