jesuiskirill / Annotations

How to add link inside text in Android
https://medium.com/@kirillsuslov/how-to-add-link-inside-text-in-android-f5bd50c03dbe
1 stars 1 forks source link

it.value not found #1

Open cybertank378 opened 5 years ago

cybertank378 commented 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

csilouanos commented 5 years ago

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!