Android examples for Graphics:Spannable
Apply only the spans from src to dst specific by spans.
//package com.java2s; import android.support.annotation.NonNull; import android.text.Spannable; import android.text.Spanned; import java.util.Collection; public class Main { /**//w ww . ja v a2s. c o m * Apply only the spans from src to dst specific by spans. * * @see {@link android.text.TextUtils#copySpansFrom} */ public static void copySpans(@NonNull Spanned src, @NonNull Spannable dst, @NonNull Collection<Object> spans) { for (Object span : spans) { int start = src.getSpanStart(span); int end = src.getSpanEnd(span); int flags = src.getSpanFlags(span); dst.setSpan(span, start, end, flags); } } }