Open cybertank378 opened 5 years ago
val anotasi = fullText.getSpans(0, fullText.length, Annotation::class.java)
anotasi?.find { it.value == "help_link" }?.let { spannableString.apply { setSpan( clickableSpan, fullText.getSpanStart(it), fullText.getSpanEnd(it), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE ) setSpan( ForegroundColorSpan( ContextCompat.getColor(this@LoginActivity, R.color.colorAccent)), fullText.getSpanStart(it), fullText.getSpanEnd(it), 0 ) } }
it.value not found
Hello!
You need to ensure that the right package has been imported. In our case the android.text.Annotation should be imported, not anything else!
val anotasi = fullText.getSpans(0, fullText.length, Annotation::class.java)
anotasi?.find { it.value == "help_link" }?.let { spannableString.apply { setSpan( clickableSpan, fullText.getSpanStart(it), fullText.getSpanEnd(it), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE ) setSpan( ForegroundColorSpan( ContextCompat.getColor(this@LoginActivity, R.color.colorAccent)), fullText.getSpanStart(it), fullText.getSpanEnd(it), 0 ) } }
it.value not found