I have searched internet and tried the following code but its not working
SpannableString ss1 = new SpannableString(\"Health: \");
ss1.setSpan(new and
Below I have mentioned the code which one through you can create spannableString in Kotlin
val spannableStringBuilder = SpannableStringBuilder()
val boldSpan: StyleSpan = StyleSpan(Typeface.BOLD)
sp_text.setSpan(boldSpan, firstIndex, lastIndex,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
sp_text.setSpan(clickableSpan, firstIndex, lastIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
sp_text.setSpan(ForegroundColorSpan(ContextCompat.getColor(mContext, R.color.colorPrimary)), firstIndex, lastIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)